Skip to content

Commit

Permalink
change precommit and pre-push fille to .sh
Browse files Browse the repository at this point in the history
  • Loading branch information
roi1410 committed May 23, 2024
1 parent b4fc8b4 commit 263cd60
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
Empty file added .husky/_/.gitignore
Empty file.
36 changes: 36 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

readonly husky_skip_init=1
export husky_skip_init
sh -e "$0" "$@"
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi

exit $exitCode
fi
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

5 changes: 5 additions & 0 deletions .husky/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run precommit
1 change: 0 additions & 1 deletion .husky/pre-push

This file was deleted.

5 changes: 5 additions & 0 deletions .husky/pre-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prepush

0 comments on commit 263cd60

Please sign in to comment.