Skip to content

Commit e45bbfe

Browse files
committed
report exit code on diff failure
1 parent a68965d commit e45bbfe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

deploy.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,19 @@ git --work-tree "$deploy_directory" reset --mixed --quiet
4242

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

45-
case `git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD` in
45+
diff=`git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD`
46+
case $diff in
4647
0) echo No changes to files in $deploy_directory. Skipping commit.;;
4748
1)
4849
set_user_id
4950
git --work-tree "$deploy_directory" commit -m \
5051
"publish: $commit_title"$'\n\n'"generated from commit $commit_hash"
5152
git push origin $deploy_branch
5253
;;
53-
*) exit 1;;
54+
*)
55+
echo git diff exited with code $diff. Aborting.
56+
exit $diff
57+
;;
5458
esac
5559

5660
if [[ $previous_branch = "HEAD" ]]; then

0 commit comments

Comments
 (0)