Skip to content

Commit 84a7f5b

Browse files
committed
Use case to force allow_empty_commits to be either true or false
1 parent 4638afc commit 84a7f5b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ echo '::endgroup::'
5050
echo '::group::Publishing'
5151
git remote add aur "ssh://aur@aur.archlinux.org/${pkgname}.git"
5252
git add -fv PKGBUILD .SRCINFO
53-
if [[ $allow_empty_commits == 'true' ]]; then
54-
git commit --allow-empty -m "$commit_message"
55-
else
56-
git diff-index --quiet HEAD || git commit -m "$commit_message" # use `git diff-index --quiet HEAD ||` to avoid error
57-
fi
53+
case "$allow_empty_commits" in
54+
true) git commit --allow-empty -m "$commit_message";;
55+
false) git diff-index --quiet HEAD || git commit -m "$commit_message";; # use `git diff-index --quiet HEAD ||` to avoid error
56+
*) echo 'The option "allow_empty_commits" should be either "true" or "false".' && false;;
57+
esac
5858
git push --force-with-lease -v aur master
5959
echo '::endgroup::'

0 commit comments

Comments
 (0)