Tweak updater script

This commit is contained in:
Nathan McCarty 2023-05-15 22:41:47 -04:00
parent 8f64710826
commit b18d67a386
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
1 changed files with 8 additions and 10 deletions

View File

@ -4,17 +4,15 @@ set -exou pipefail
TEMP_DIR=$(mktemp -d "repo-updater.XXXX" -p $XDG_RUNTIME_DIR) TEMP_DIR=$(mktemp -d "repo-updater.XXXX" -p $XDG_RUNTIME_DIR)
pushd $TEMP_DIR pushd $TEMP_DIR
git clone "$1" repo if git clone "$1" repo && pushd repo && git switch $2 && ./update.sh; then
pushd repo git add -A
git switch $2 if git commit S -m "Update flake/dependencies"; then
./update.sh
git add -A
if git commit -m "Update flake/dependencies"; then
git push -u origin $2 git push -u origin $2
else else
echo "No changes made" echo "No changes made"
fi
else
echo "Update failed"
fi fi
popd popd