From 00f6999924663282a6c619c4af8cdc29e7f3a004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Mon, 11 Sep 2023 18:29:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20(.vscode)=20modify=20upgrade=20s?= =?UTF-8?q?cript=20to=20hang=20on=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/upgrade.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.vscode/upgrade.sh b/.vscode/upgrade.sh index 13125fc..c09dcf2 100755 --- a/.vscode/upgrade.sh +++ b/.vscode/upgrade.sh @@ -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"