2021-10-03 10:37:13 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-10-03 12:01:13 +02:00
|
|
|
set -ex # WARNING: Chaos ahead!
|
2021-10-03 10:37:13 +02:00
|
|
|
|
|
|
|
DOTFILES_HOME=${DOTFILES_HOME:-"$HOME/.dotfiles"}
|
|
|
|
DOTFILES_SYNC_COMMIT_MSG="Synchorized userland configuration to personal GitHub dotfiles repo"
|
|
|
|
|
|
|
|
if [[ $SKIP_REBASE_STEP == "" ]]; then
|
|
|
|
git -C "$DOTFILES_HOME" pull --rebase --progress --verbose # Attempt to rebase from upstream remote.
|
2021-10-03 12:01:13 +02:00
|
|
|
else
|
|
|
|
git -C "$DOTFILES_HOME" pull --progress --verbose # otherwise just pull stuff if rebase is being skipped
|
2021-10-03 10:37:13 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
git -C "$DOTFILES_HOME" add . --verbose # Add everything
|
|
|
|
git -C "$DOTFILES_HOME" commit --verbose --signoff --gpg-sign -m "$DOTFILES_SYNC_COMMIT_MSG" # Use an predefined commit message btw.
|
|
|
|
git -C "$DOTFILES_HOME" push --verbose --progress # ..and push to prod!
|