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,18 +4,16 @@ 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 switch $2
./update.sh
git add -A git add -A
if git commit -m "Update flake/dependencies"; then if git commit S -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 fi
else
echo "Update failed"
fi
popd popd
popd popd