diff --git a/docs/README.md b/docs/README.md index d1a74c5cb..2c3585ef1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,10 +39,10 @@ To add another hook use `husky add`. For example: ```shell # npm -npx husky add .husky/commit-msg 'npx --no commitlint --edit "$1"' +npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"' # yarn -yarn husky add .husky/commit-msg 'npx --no commitlint --edit "$1"' +yarn husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"' ``` ## Manual @@ -361,7 +361,7 @@ If you were calling directly locally installed binaries, **you need to run them ```shell # .husky/pre-commit (v5) # ... -npx --no jest +npx --no-install jest yarn jest ``` @@ -381,7 +381,7 @@ Previous `HUSKY_GIT_PARAMS` environment variable is replaced by native params `$ ```shell # .husky/commit-msg (v5) # ... -npx --no commitlint --edit $1 +npx --no-install commitlint --edit $1 # or yarn commitlint --edit $1 ``` diff --git a/test/config-dir.sh b/test/config-dir.sh index 21b7e9067..a040983bb 100644 --- a/test/config-dir.sh +++ b/test/config-dir.sh @@ -14,8 +14,8 @@ cd_and_install_tgz $tempDir mkdir $configDir init_git -npx --no husky install .config/husky -npx --no husky add .config/husky/pre-commit "echo \"msg from pre-commit hook\" && exit 1" +npx --no-install husky install .config/husky +npx --no-install husky add .config/husky/pre-commit "echo \"msg from pre-commit hook\" && exit 1" # Debug # cat .husky/* diff --git a/test/default.sh b/test/default.sh index eb810ab63..882aad6f9 100644 --- a/test/default.sh +++ b/test/default.sh @@ -10,8 +10,8 @@ rm -rf $tempDir cd_and_install_tgz $tempDir init_git -npx --no husky install -npx --no husky add .husky/pre-commit "echo \"msg from pre-commit hook\" && exit 1" +npx --no-install husky install +npx --no-install husky add .husky/pre-commit "echo \"msg from pre-commit hook\" && exit 1" # Debug # cat .husky/* @@ -24,5 +24,5 @@ git add package.json git commit -m "should fail" || echo -e "\e[0;32mOK\e[m" # Uninstall -npx --no husky uninstall +npx --no-install husky uninstall git config core.hooksPath || echo -e "\e[0;32mOK\e[m" diff --git a/test/init.sh b/test/init.sh index ce4ffd59e..d5e0536be 100644 --- a/test/init.sh +++ b/test/init.sh @@ -10,7 +10,7 @@ rm -rf $tempDir cd_and_install_tgz $tempDir init_git -npx --no husky init +npx --no-install husky init npm set-script test "echo \"msg from pre-commit hook\" && exit 1" @@ -28,5 +28,5 @@ git add package.json git commit -m "should fail" || echo -e "\e[0;32mOK\e[m" # Uninstall -npx --no husky uninstall +npx --no-install husky uninstall git config core.hooksPath || echo -e "\e[0;32mOK\e[m" diff --git a/test/not-git-dir.sh b/test/not-git-dir.sh index 2ebb38667..fb4a7e365 100644 --- a/test/not-git-dir.sh +++ b/test/not-git-dir.sh @@ -10,4 +10,4 @@ rm -rf $tempDir cd_and_install_tgz $tempDir # Should not fail -npx --no husky install && echo -e "\e[0;32mOK\e[m" +npx --no-install husky install && echo -e "\e[0;32mOK\e[m" diff --git a/test/sub-dir.sh b/test/sub-dir.sh index 7020ad779..b4e72b619 100644 --- a/test/sub-dir.sh +++ b/test/sub-dir.sh @@ -30,7 +30,7 @@ EOL npm run postinstall # Add hook -npx --no husky add pre-commit "echo \"msg from pre-commit hook\" && exit 1" +npx --no-install husky add pre-commit "echo \"msg from pre-commit hook\" && exit 1" # Debug # cat .husky/*