skip asking if w-i-p should be pushed if the lockfile exists
This commit is contained in:
parent
b731c6e237
commit
ee12e9425d
|
@ -2,14 +2,15 @@
|
||||||
|
|
||||||
wips=$(git log --oneline --no-decorate | grep -i wip )
|
wips=$(git log --oneline --no-decorate | grep -i wip )
|
||||||
wips_n=$(echo "$wips" | wc -l)
|
wips_n=$(echo "$wips" | wc -l)
|
||||||
|
LOCKFILE=/tmp/githook.allow_wip
|
||||||
|
|
||||||
if [[ -n "$wips" ]]; then
|
if [[ ! -f $LOCKFILE || -n "$wips" ]]; then
|
||||||
# Allows us to read user input below, assigns stdin to keyboard
|
# Allows us to read user input below, assigns stdin to keyboard
|
||||||
exec < /dev/tty
|
exec < /dev/tty
|
||||||
echo "contains $wips_n WIP commit(s)"
|
echo "contains $wips_n WIP commit(s)"
|
||||||
read -p "Really push? (Y/N) " -n 1 -r
|
read -p "Really push? (Y/N) " -n 1 -r
|
||||||
case "$REPLY" in
|
case "$REPLY" in
|
||||||
y|Y ) echo -e "\ncontinuing...";;
|
y|Y ) echo -e "\ncontinuing..."; touch $LOCKFILE;;
|
||||||
* ) echo -e "\naborting."; exit 1;;
|
* ) echo -e "\naborting."; exit 1;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue