Comparing version 0.14.0-1 to 0.14.0
@@ -35,3 +35,3 @@ 'use strict' | ||
expect(hook).toMatch('cd .') | ||
expect(hook).toMatch('npm run precommit') | ||
expect(hook).toMatch('npm run -s precommit') | ||
expect(hook).toMatch('--no-verify') | ||
@@ -38,0 +38,0 @@ |
# CHANGELOG | ||
## Unreleased | ||
## 0.14.0 | ||
* Drop Node 0.12 support | ||
* Don't reload nvm if it's already in PATH | ||
* Fix `npm@5` `Error: Cannot find module` warning when uninstalling | ||
* Drop `Node 0.12` support | ||
* Don't reload `nvm` if it's already in `PATH` | ||
* Add Git worktree support [#114](https://github.com/typicode/husky/pull/114) | ||
@@ -8,0 +9,0 @@ * Hide irrelevant `--no-verify` message for `prepare-commit-msg` [#137](https://github.com/typicode/husky/issues/137) |
{ | ||
"name": "husky", | ||
"version": "0.14.0-1", | ||
"version": "0.14.0", | ||
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)", | ||
@@ -11,4 +11,2 @@ "engines": { | ||
"format": "prettier --single-quote --no-semi --write **/*.js", | ||
"precommit": "npm test && npm format", | ||
"prepublishOnly": "pkg-ok", | ||
"install": "node ./bin/install.js", | ||
@@ -42,10 +40,6 @@ "uninstall": "node ./bin/uninstall.js" | ||
"devDependencies": { | ||
"expect": "^1.20.2", | ||
"jest": "^20.0.4", | ||
"mocha": "^3.2.0", | ||
"mock-fs": "^4.4.1", | ||
"pkg-ok": "^1.0.1", | ||
"prettier": "^1.4.4", | ||
"rimraf": "^2.2.8", | ||
"standard": "^8.6.0" | ||
"rimraf": "^2.2.8" | ||
}, | ||
@@ -52,0 +46,0 @@ "dependencies": { |
@@ -41,3 +41,3 @@ # husky [![](http://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![npm version](https://badge.fury.io/js/husky.svg)](https://www.npmjs.com/package/husky) [![Build Status](https://travis-ci.org/typicode/husky.svg?branch=master)](https://travis-ci.org/typicode/husky) | ||
* [Hotel](https://github.com/typicode/hotel) | ||
* ... and almost 4000+ [other awesome projects](https://libraries.io/npm/husky/dependent-repositories). | ||
* ... and over 5000+ [other awesome projects](https://libraries.io/npm/husky/dependent-repositories). | ||
@@ -86,3 +86,3 @@ ## Uninstall | ||
### Git submodule support | ||
### Git submodule and subtree support | ||
@@ -89,0 +89,0 @@ Yes |
'use strict' | ||
const fs = require('fs') | ||
@@ -3,0 +4,0 @@ const path = require('path') |
@@ -32,4 +32,4 @@ 'use strict' | ||
export PATH=$PATH:/usr/local/bin:/usr/local | ||
`) | ||
export PATH=$PATH:/usr/local/bin:/usr/local` | ||
) | ||
] | ||
@@ -48,8 +48,2 @@ | ||
function noVerifyMessage(hookName) { | ||
return hookName === 'prepare-commit-msg' | ||
? '(cannot be bypassed with --no-verify due to Git specs)' | ||
: '(add --no-verify to bypass)' | ||
} | ||
module.exports = function getHookScript(hookName, relativePath, npmScriptName) { | ||
@@ -59,2 +53,6 @@ // On Windows normalize path (i.e. convert \ to /) | ||
const noVerifyMessage = hookName === 'prepare-commit-msg' | ||
? '(cannot be bypassed with --no-verify due to Git specs)' | ||
: '(add --no-verify to bypass)' | ||
// Hook script | ||
@@ -78,4 +76,2 @@ return [ | ||
# Fix for issue #16 #24 | ||
# If script is not defined in package.json then exit | ||
has_hook_script ${npmScriptName} || exit 0` | ||
@@ -86,5 +82,4 @@ ).trim(), | ||
` | ||
# Test if npm is in PATH | ||
command_exists npm || { | ||
echo >&2 "> husky - Can't find npm in PATH. Skipping ${npmScriptName} script in package.json" | ||
echo >&2 "husky > Can't find npm in PATH. Skipping ${npmScriptName} script in package.json" | ||
exit 0 | ||
@@ -97,10 +92,7 @@ } | ||
# Run script | ||
echo "husky > npm run -s ${npmScriptName} (node \`node -v\`)" | ||
echo | ||
echo "> husky - npm run -s ${npmScriptName}" | ||
echo "> husky - node \`node -v\`" | ||
echo | ||
npm run -s ${npmScriptName} || { | ||
echo | ||
echo "> husky - ${hookName} hook failed ${noVerifyMessage(hookName)}" | ||
echo "> husky - to debug, use 'npm run ${npmScriptName}'" | ||
echo "husky > ${hookName} hook failed ${noVerifyMessage}" | ||
exit 1 | ||
@@ -107,0 +99,0 @@ }` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
88697
397