From d12da385fd0559b18bdcfdc9fe2a62ff720dba00 Mon Sep 17 00:00:00 2001 From: ranomier Date: Sat, 14 Dec 2024 15:47:13 +0100 Subject: [PATCH] start shell with changed directory --- nswitch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nswitch b/nswitch index 07c4ece..ed2c3ec 100755 --- a/nswitch +++ b/nswitch @@ -12,7 +12,7 @@ printf ">>> auto formating ..." nix fmt . &> /dev/null printf " DONE!\n" -[ -z "$(git diff -U0)" ] && echo ">>> no changes, exiting ..." && exit 0 +[ -z "$(git diff -U0)" ] && echo ">>> no changes, exiting ..." && "$SHELL" && exit 0 git diff -U0 # "*.nix" # as a seperate command so we get nice colors and pager printf ">>> Do you want to rebuild NixOS? [y/N]\n" @@ -27,3 +27,5 @@ sudo nixos-rebuild switch | tee nixos-switch.log || ( grep --color error nixos-switch.log && false) gen=$(nixos-rebuild list-generations | grep current) git commit -am "$gen" + +"$SHELL"