about summary refs log tree commit diff stats
path: root/home-manager/packages/scripts/small_functions/update-sys
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-05-28 22:13:25 +0200
committerSoispha <soispha@vhack.eu>2023-05-28 22:13:25 +0200
commitdf2e5904b9060d7b39f7ade123d1f5912dbeb06f (patch)
tree1107ea237ee28c221c76cf9e6cbd0bb1d9cc49d7 /home-manager/packages/scripts/small_functions/update-sys
parentDocs(hm/wms/river/init): Add a hint to simplify script (diff)
downloadnixos-config-df2e5904b9060d7b39f7ade123d1f5912dbeb06f.tar.gz
nixos-config-df2e5904b9060d7b39f7ade123d1f5912dbeb06f.zip
Fix(hm/pkgs/scrs): Rework some of them
Diffstat (limited to '')
-rwxr-xr-xhome-manager/packages/scripts/small_functions/update-sys6
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