diff options
author | Soispha <soispha@vhack.eu> | 2023-04-15 17:08:49 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-05-09 19:30:44 +0200 |
commit | a3ccd164572621cf5de8a07c910f800bcefb04c0 (patch) | |
tree | 5817acff33cec7eb68e65ef4a3c5e2f42e4e05bc /home-manager/packages/scripts/small_functions | |
parent | Feat(hm/conf/neomutt): Enable mail check (diff) | |
download | nixos-config-a3ccd164572621cf5de8a07c910f800bcefb04c0.tar.gz nixos-config-a3ccd164572621cf5de8a07c910f800bcefb04c0.zip |
Fix(hm/pkgs/scr/update): Streamline output
Diffstat (limited to 'home-manager/packages/scripts/small_functions')
-rwxr-xr-x | home-manager/packages/scripts/small_functions/update | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/home-manager/packages/scripts/small_functions/update b/home-manager/packages/scripts/small_functions/update index e4cdbdfd..23408327 100755 --- a/home-manager/packages/scripts/small_functions/update +++ b/home-manager/packages/scripts/small_functions/update @@ -16,10 +16,8 @@ help() { EOF exit "$1"; } -name="$0"; -[ "$name" = "" ] && name=update; +name="update"; tmp=$(mktmp); -git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > $tmp & BRANCH=""; while [ "$#" -gt 0 ];do @@ -44,10 +42,14 @@ while [ "$#" -gt 0 ];do done -cd /etc/nixos || die "No /etc/nixos" -git pull --rebase -[ "$BRANCH" = "" ] || git switch "$BRANCH"; -nixos-rebuild switch -git switch "$(cat $tmp)"; +cd /etc/nixos || die "No /etc/nixos"; +git pull --rebase > /dev/null; +if [ "$BRANCH" = "" ];then + git switch "$BRANCH" > /dev/null; + git pull --rebase; +fi +git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > $tmp & +nixos-rebuild switch; +git switch "$(cat $tmp)" > /dev/null; # vim: ft=sh |