Skip to content

Commit b7ab3c2

Browse files
committed
update acm-hook.sh
1 parent 2fbd393 commit b7ab3c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shell/acm-hook.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# This is a pure CLI script that bypasses using VS Code or an extension.
88
# It will get output from Git, send it to Node CLI entry-point tool and print
9-
# it. This can be used as part of Git commit message hook flow.
9+
# it. This can be used as part of Git commit message hook flow (pre-commit hook).
1010
#
1111
# Optionally add a `-d` debug flag to print without writing to a file. This
1212
# makes it easy to debug the script outside a Git commit hook flow.
@@ -15,6 +15,11 @@
1515
# See shell/README.md doc.
1616
set -e
1717

18+
if ! command -v acm &> /dev/null; then
19+
echo "Error: `acm` could not be found"
20+
exit 1
21+
fi
22+
1823
COMMIT_MSG_FILE=$1
1924
COMMIT_SOURCE=$2
2025

@@ -30,7 +35,7 @@ if [ "$COMMIT_SOURCE" = 'template']; then
3035
fi
3136

3237
CHANGES=$(git diff-index --name-status HEAD)
33-
MESSAGE=$(node acm "$CHANGES")
38+
MESSAGE=$(acm "$CHANGES")
3439

3540
if [ "$1" = '-p' ]; then
3641
echo "$MESSAGE"

0 commit comments

Comments
 (0)