Skip to content

Commit

Permalink
makes gister auto-commit dirty gist repos if the GISTER_AUTO_COMMIT e…
Browse files Browse the repository at this point in the history
…nv var is set to anything
  • Loading branch information
irobl committed Jun 6, 2019
1 parent bbb04ac commit 9b1896c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gister.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,13 @@ sync_gist() {
legit sync > /dev/null
else
if (is_dirty); then
echo "DIRTY $gist_id"
if [ -z $GISTER_AUTO_COMMIT ]; then
echo "DIRTY $gist_id"
else
echo "DIRTY $gist_id, auto committing"
git add . && git commit -m "automated update" && \
git pull > /dev/null && git push > /dev/null
fi
else
git pull > /dev/null && git push > /dev/null
fi
Expand Down

0 comments on commit 9b1896c

Please sign in to comment.