Skip to content

Commit ad5b7cd

Browse files
🐛 fix: Fix hook in wsl
1 parent e03229b commit ad5b7cd

File tree

1 file changed

+10
-8
lines changed
  • packages/lobe-commit/src/constants

1 file changed

+10
-8
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
export const HOOK = {
2-
CONTENTS:
3-
'#!/usr/bin/env sh\n# lobe-commit as a commit hook\n' +
4-
'if npx -v >&/dev/null\n' +
5-
'then\n' +
6-
' exec < /dev/tty\n npx -c "lobe-commit --hook $1 $2"\n' +
7-
'else\n' +
8-
' exec < /dev/tty\n lobe-commit --hook $1 $2\n' +
9-
'fi',
2+
CONTENTS: `#!/usr/bin/env sh
3+
# lobe-commit as a commit hook
4+
if npx -v >/dev/null 2>&1
5+
then
6+
exec < /dev/tty
7+
npx -c "lobe-commit --hook $1 $2"
8+
else
9+
exec < /dev/tty
10+
lobe-commit --hook $1 $2
11+
fi`,
1012
FILENAME: 'prepare-commit-msg',
1113
PERMISSIONS: 0o775,
1214
};

0 commit comments

Comments
 (0)