Skip to content

Commit

Permalink
Pass all arguments to downstream hooks (#231)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Birukov <[email protected]>
  • Loading branch information
2 people authored and Envek committed Oct 2, 2021
1 parent c4bd956 commit 8eda3be
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions cmd/templates/hook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ call_lefthook()
{
if lefthook{{.Extension}} -h >/dev/null 2>&1
then
eval lefthook{{.Extension}} $1
eval lefthook{{.Extension}} $@
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook{{.Extension}}"
then
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook{{.Extension}} $1"
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook{{.Extension}} $@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook $1
bundle exec lefthook $@
elif npx @arkweid/lefthook -h >/dev/null 2>&1
then
npx lefthook $1
npx lefthook $@
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook $1
yarn lefthook $@
else
echo "Can't find lefthook in PATH"
fi
Expand Down
10 changes: 5 additions & 5 deletions spec/fixtures/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ call_lefthook()
{
if lefthook -h >/dev/null 2>&1
then
eval lefthook $1
eval lefthook $@
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook"
then
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $1"
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook $1
bundle exec lefthook $@
elif npx lefthook -h >/dev/null 2>&1
then
npx lefthook $1
npx lefthook $@
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook $1
yarn lefthook $@
else
echo "Can't find lefthook in PATH"
fi
Expand Down
10 changes: 5 additions & 5 deletions spec/fixtures/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ call_lefthook()
{
if lefthook -h >/dev/null 2>&1
then
eval lefthook $1
eval lefthook $@
elif test -f "$dir/node_modules/@arkweid/lefthook/bin/lefthook"
then
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $1"
eval "$dir/node_modules/@arkweid/lefthook/bin/lefthook $@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook $1
bundle exec lefthook $@
elif npx lefthook -h >/dev/null 2>&1
then
npx lefthook $1
npx lefthook $@
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook $1
yarn lefthook $@
else
echo "Can't find lefthook in PATH"
fi
Expand Down

0 comments on commit 8eda3be

Please sign in to comment.