-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
326 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
#!/usr/bin/env sh | ||
# shellcheck disable=SC1090 | ||
[ "$HUSKY" = "2" ] && set -x | ||
if command -v cygpath >/dev/null 2>&1; then | ||
u0=$(cygpath -u "$0") | ||
if [ "$0" != "$u0" ]; then | ||
exec "$u0" "$@" | ||
fi | ||
fi | ||
|
||
h="${0##*/}" | ||
s="${0%/*/*}/$h" | ||
n=$(basename "$0") | ||
s=$(dirname "$(dirname "$0")")/$n | ||
|
||
[ ! -f "$s" ] && exit 0 | ||
|
||
for f in "${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" "$HOME/.huskyrc"; do | ||
# shellcheck disable=SC1090 | ||
[ -f "$f" ] && . "$f" | ||
done | ||
if [ -f "$HOME/.huskyrc" ]; then | ||
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh" | ||
fi | ||
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" | ||
[ -f "$i" ] && . "$i" | ||
|
||
[ "${HUSKY-}" = "0" ] && exit 0 | ||
|
||
sh -e "$s" "$@" | ||
c=$? | ||
|
||
[ $c != 0 ] && echo "husky - $h script failed (code $c)" | ||
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH" | ||
exit $c | ||
c=0 | ||
h() { | ||
[ $c = 0 ] && return | ||
[ $c != 0 ] && echo "husky - $n script failed (code $c)" | ||
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH" | ||
exit 1 | ||
} | ||
trap 'c=$?; h' EXIT | ||
set -e | ||
PATH=node_modules/.bin:$PATH | ||
. "$s" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
. test/functions.sh | ||
setup | ||
install | ||
|
||
npx --no-install husky | ||
|
||
# Test pre-commit | ||
git add package.json | ||
echo 'echo "$PATH" | grep -q "node_modules/.bin"' > .husky/pre-commit | ||
expect 0 "git commit -m foo" |
File renamed without changes.
File renamed without changes.