diff options
Diffstat (limited to 'home-manager/packages/scripts/small_functions/update-sys')
-rwxr-xr-x | home-manager/packages/scripts/small_functions/update-sys | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/home-manager/packages/scripts/small_functions/update-sys b/home-manager/packages/scripts/small_functions/update-sys index c1df4f48..067647b4 100755 --- a/home-manager/packages/scripts/small_functions/update-sys +++ b/home-manager/packages/scripts/small_functions/update-sys @@ -20,7 +20,7 @@ Options: EOF exit "$1"; } -tmp=$(mktmp); +default_branch=$(mktmp); BRANCH=""; while [ "$#" -gt 0 ];do @@ -63,7 +63,7 @@ fi msg2 "Updating git repository..."; git pull --rebase; -git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > $tmp & +git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > "$default_branch" & msg2 "Updating system..."; if [ -n "$MODE" ]; then @@ -72,7 +72,7 @@ else nixos-rebuild switch; fi -git switch "$(cat $tmp)" > /dev/null 2>&1 && msg2 "Switched to branch '$(cat $tmp)'"; +git switch "$(cat "$default_branch")" > /dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'"; msg "Finished Update!"; # vim: ft=sh |