Skip to content

Commit fdd0e1f

Browse files
test(cli): update hook path snapshots
1 parent 780f4ce commit fdd0e1f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

  • packages/cli/snap-tests-global

packages/cli/snap-tests-global/migration-add-git-hooks/snap.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,21 @@ i="${XDG_CONFIG_HOME:-$HOME/.config}/vite-plus/hooks-init.sh"
5959

6060
{ [ "${HUSKY-}" = "0" ] || [ "${VITE_GIT_HOOKS-}" = "0" ]; } && exit 0
6161

62+
d="$(dirname "$(dirname "$(dirname "$0")")")"
63+
__vp_shell=/bin/sh
64+
[ -x "$__vp_shell" ] || __vp_shell=$(command -v sh)
65+
6266
if [ -n "${VP_HOME-}" ]; then
6367
__vp_bin="$VP_HOME/bin"
6468
elif [ -n "${HOME-}" ]; then
6569
__vp_bin="$HOME/.vite-plus/bin"
6670
else
6771
__vp_bin=""
6872
fi
69-
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$__vp_bin:$PATH"
73+
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$PATH:$__vp_bin"
7074

71-
d="$(dirname "$(dirname "$(dirname "$0")")")"
7275
export PATH="$d/node_modules/.bin:$PATH"
73-
sh -e "$s" "$@"
76+
"$__vp_shell" -e "$s" "$@"
7477
c=$?
7578

7679
[ $c != 0 ] && echo "VITE+ - $n script failed (code $c)"

packages/cli/snap-tests-global/migration-composed-husky-custom-dir/snap.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ i="${XDG_CONFIG_HOME:-$HOME/.config}/vite-plus/hooks-init.sh"
5151

5252
{ [ "${HUSKY-}" = "0" ] || [ "${VITE_GIT_HOOKS-}" = "0" ]; } && exit 0
5353

54+
d="$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")"
55+
__vp_shell=/bin/sh
56+
[ -x "$__vp_shell" ] || __vp_shell=$(command -v sh)
57+
5458
if [ -n "${VP_HOME-}" ]; then
5559
__vp_bin="$VP_HOME/bin"
5660
elif [ -n "${HOME-}" ]; then
5761
__vp_bin="$HOME/.vite-plus/bin"
5862
else
5963
__vp_bin=""
6064
fi
61-
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$__vp_bin:$PATH"
65+
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$PATH:$__vp_bin"
6266

63-
d="$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")"
6467
export PATH="$d/node_modules/.bin:$PATH"
65-
sh -e "$s" "$@"
68+
"$__vp_shell" -e "$s" "$@"
6669
c=$?
6770

6871
[ $c != 0 ] && echo "VITE+ - $n script failed (code $c)"

0 commit comments

Comments
 (0)