🎨 (.vscode) modify upgrade script to hang on errors
This commit is contained in:
parent
7733093525
commit
00f6999924
12
.vscode/upgrade.sh
vendored
12
.vscode/upgrade.sh
vendored
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue