1
0
Fork 0

Autocommitted updated scripts from blocky-cafe

main
Marissa Staib 5 years ago
parent 8dbbf06b7f
commit 1771367320
  1. 16
      bash_aliases.sh

@ -58,14 +58,20 @@ function sync_git_only()
{
(
cd "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )"
needs_push=false
if git add . && ! git diff-index --cached --quiet HEAD; then
git commit -am "Autocommitted updated scripts from ${hostname}"
needs_push=true
git commit -am "Autocommitted updated scripts from $(hostname)"
fi
git pull --rebase
if [[ "$needs_push" == "true" ]]; then
git push
if ! git diff --exit-code origin/master master; then
git log --reverse origin..master
if ! read "OK to push these changes? (Y/N) " confirm; then
confirm = "N"
fi
if [[ "$confirm" != "Y" ]]; then
echo "Not pushing yet."
else
git push
fi
fi
)
}

Loading…
Cancel
Save