Skip to content

Commit 7cd5f08

Browse files
🔧 config(commit-msg): Abort immediately if not tty.
1 parent ccf57c9 commit 7cd5f08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function ask () {
4444
}
4545

4646
while ! npm run commit-msg -- "$1" ; do
47-
if ask 'There was an error. Do you wish to amend your commit message?' Y ; then
47+
if [ -t 1 ] && ask 'There was an error. Do you wish to amend your commit message?' Y ; then
4848
${GIT_EDITOR:-$EDITOR} "$1" < /dev/tty
4949
else
5050
exit 1

0 commit comments

Comments
 (0)