Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass all arguments to downstream hooks #231

Merged
merged 1 commit into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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