From c646f126e2cbc06eb76de7206d75d444ef295b5c Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 5 Jul 2022 19:16:08 -0400 Subject: [PATCH] commandline append in uncommitted and darwin-rebuild --- modules/darwin/dotfiles.nix | 8 ++++---- modules/shell/fish/functions/uncommitted.fish | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/darwin/dotfiles.nix b/modules/darwin/dotfiles.nix index df47921..8412e1b 100644 --- a/modules/darwin/dotfiles.nix +++ b/modules/darwin/dotfiles.nix @@ -13,10 +13,10 @@ if test "$argv[1]" = "offline" set option "--option substitute false" end - commandline -r "git -C ${config.dotfilesPath} add --all" - commandline -f execute - commandline -r "darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook" - commandline -f execute + commandline --replace "git -C ${config.dotfilesPath} add --all" + commandline --append " + darwin-rebuild switch $option --flake ${config.dotfilesPath}#macbook" + commandline --function execute ''; }; }; diff --git a/modules/shell/fish/functions/uncommitted.fish b/modules/shell/fish/functions/uncommitted.fish index 4e4fcc9..0026043 100644 --- a/modules/shell/fish/functions/uncommitted.fish +++ b/modules/shell/fish/functions/uncommitted.fish @@ -1,11 +1,9 @@ -set current_dir (pwd) -cd $HOME/dev -find . -type d -name '.git' | while read dir - cd $dir/../ - and if test -n (echo (git status -s)) - pwd - git status -s +echo "Searching git repos..." >&2 +find "$HOME/dev" -type d -name '.git' | while read dir + set fullPath (dirname "$dir") + set relativePath (echo "$fullPath" | cut -d'/' -f5-) + if test -n (echo (git -C "$fullPath" status -s)) + echo "$relativePath" + git -C "$fullPath" status -s end - cd - end -cd $current_dir