1
0
Fork 0

Bin: autoupgrade tweaks again

This commit is contained in:
Aires 2024-10-01 10:45:29 -04:00
parent 8791642454
commit c8b56f709e

View file

@ -41,7 +41,6 @@ while [[ $# -gt 0 ]]; do
--no-update|--no-upgrade|-n) --no-update|--no-upgrade|-n)
update=false update=false
shift shift
shift
;; ;;
--operation|-o) --operation|-o)
operation="$2" operation="$2"
@ -55,11 +54,11 @@ while [[ $# -gt 0 ]]; do
;; ;;
--help|-h) --help|-h)
usage usage
shift exit 0
;; ;;
*) *)
POSITIONAL_ARGS+=("$1") # save positional arg POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument shift
;; ;;
esac esac
done done
@ -77,9 +76,8 @@ echo "Pulling the latest version of the repository..."
/run/wrappers/bin/sudo -u $user git pull /run/wrappers/bin/sudo -u $user git pull
if [ $update = true ]; then if [ $update = true ]; then
echo "Checking for updates..." echo "Updating flake.lock..."
/run/wrappers/bin/sudo -u $user nix flake update --commit-lock-file /run/wrappers/bin/sudo -u $user nix flake update --commit-lock-file && /run/wrappers/bin/sudo -u $user git push
/run/wrappers/bin/sudo -u $user git push
else else
echo "Skipping 'nix flake update'..." echo "Skipping 'nix flake update'..."
fi fi