From df2e5904b9060d7b39f7ade123d1f5912dbeb06f Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 28 May 2023 22:13:25 +0200 Subject: Fix(hm/pkgs/scrs): Rework some of them --- home-manager/packages/scripts/small_functions/update-sys | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'home-manager/packages/scripts/small_functions/update-sys') 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 -- cgit 1.4.1