From c8b56f709e519aaf3f6cd0322d15e4ee620f0a1f Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 1 Oct 2024 10:45:29 -0400 Subject: [PATCH] Bin: autoupgrade tweaks again --- bin/nixos-upgrade-script.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/nixos-upgrade-script.sh b/bin/nixos-upgrade-script.sh index 6a45c31..2b1dbb9 100755 --- a/bin/nixos-upgrade-script.sh +++ b/bin/nixos-upgrade-script.sh @@ -41,7 +41,6 @@ while [[ $# -gt 0 ]]; do --no-update|--no-upgrade|-n) update=false shift - shift ;; --operation|-o) operation="$2" @@ -55,11 +54,11 @@ while [[ $# -gt 0 ]]; do ;; --help|-h) usage - shift + exit 0 ;; *) POSITIONAL_ARGS+=("$1") # save positional arg - shift # past argument + shift ;; esac done @@ -77,9 +76,8 @@ echo "Pulling the latest version of the repository..." /run/wrappers/bin/sudo -u $user git pull if [ $update = true ]; then - echo "Checking for updates..." - /run/wrappers/bin/sudo -u $user nix flake update --commit-lock-file - /run/wrappers/bin/sudo -u $user git push + echo "Updating flake.lock..." + /run/wrappers/bin/sudo -u $user nix flake update --commit-lock-file && /run/wrappers/bin/sudo -u $user git push else echo "Skipping 'nix flake update'..." fi