From c1b048b96b98f941e3a5b7be2694b320c5030d13 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Mon, 15 May 2023 22:41:47 -0400 Subject: [PATCH] Tweak updater script --- scripts/gitea/update-repo.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/gitea/update-repo.sh b/scripts/gitea/update-repo.sh index db6e56f..eed1688 100755 --- a/scripts/gitea/update-repo.sh +++ b/scripts/gitea/update-repo.sh @@ -4,17 +4,15 @@ set -exou pipefail TEMP_DIR=$(mktemp -d "repo-updater.XXXX" -p $XDG_RUNTIME_DIR) pushd $TEMP_DIR -git clone "$1" repo -pushd repo -git switch $2 - -./update.sh - -git add -A -if git commit -m "Update flake/dependencies"; then - git push -u origin $2 +if git clone "$1" repo && pushd repo && git switch $2 && ./update.sh; then + git add -A + if git commit S -m "Update flake/dependencies"; then + git push -u origin $2 + else + echo "No changes made" + fi else - echo "No changes made" + echo "Update failed" fi popd