🎨 (.vscode) modify upgrade script to hang on errors

This commit is contained in:
Laureηt 2023-09-11 18:29:05 +02:00
parent 7733093525
commit 00f6999924
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI

12
.vscode/upgrade.sh vendored
View file

@ -1,6 +1,16 @@
# error handler
handle_error() {
echo "Upgrade failed."
read -p "Press Enter to exit..."
exit 1
}
# stop on error
set -euxo pipefail
# trap any errors and call handle_error
trap 'handle_error "$BASH_COMMAND"' ERR
# update lock file
nix flake update
@ -12,3 +22,5 @@ nixos-rebuild switch -L --flake .#hydrogen --target-host hydrogen
git add flake.lock
git commit -m "⬆️ nix flake update"
git push
echo "Upgrade successful"