Skip to content

Commit

Permalink
release.sh: add flag to ignore git status
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Oct 20, 2022
1 parent bbdced4 commit ac2cd53
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#!/bin/bash

IGNORE_DIRTY=0

while [[ $# -gt 0 ]]; do
case $1 in
-i|--ignore-dirty)
IGNORE_DIRTY=1
shift;;
*)
echo Unexpected argument $1
exit 2;;
esac
done

set -ex

command -V jq

if [ -n "$(git status --porcelain .)" ]; then
echo Working copy is dirty
if [ $IGNORE_DIRTY -ne 1 ] && [ -n "$(git status --porcelain .)" ]; then
echo Working copy is dirty. Run $0 --ignore-dirty to ignore.
git status .
exit 1
fi
Expand Down

0 comments on commit ac2cd53

Please sign in to comment.