Skip to content

Commit 09f47ab

Browse files
committed
report exit code for realz
1 parent e45bbfe commit 09f47ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deploy.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -e #abort if any command fails
2+
set -o errexit #abort if any command fails
33

44
deploy_directory=dist
55
deploy_branch=gh-pages
@@ -42,7 +42,10 @@ git --work-tree "$deploy_directory" reset --mixed --quiet
4242

4343
git --work-tree "$deploy_directory" add --all
4444

45-
diff=`git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD`
45+
set +o errexit
46+
git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD
47+
diff=$?
48+
set -o errexit
4649
case $diff in
4750
0) echo No changes to files in $deploy_directory. Skipping commit.;;
4851
1)

0 commit comments

Comments
 (0)