Skip to content

Commit

Permalink
docs: rollback to npx --no-install
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Feb 22, 2021
1 parent 611630f commit e011e76
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand All @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions test/config-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
6 changes: 3 additions & 3 deletions test/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand All @@ -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"
4 changes: 2 additions & 2 deletions test/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand All @@ -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"
2 changes: 1 addition & 1 deletion test/not-git-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion test/sub-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down

0 comments on commit e011e76

Please sign in to comment.