From 71bbdaea685e2f80d407a9a745bb0310c3b03e7d Mon Sep 17 00:00:00 2001 From: Leandro Emmanuel Reina Kiperman Date: Fri, 5 Aug 2022 21:23:32 +0200 Subject: [PATCH] Fix git prompt --- shell.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/shell.nix b/shell.nix index b4d7c87..5784269 100644 --- a/shell.nix +++ b/shell.nix @@ -249,16 +249,10 @@ pkgs.mkShell { # Assign a colour to the "cleaniness" of the repo local colour colour="$( - if _is_git '${toString ./.}' ; then + if ! _is_git '${toString ./.}' ; then # No repo -> red ${coreutils}/bin/printf 9 ; - elif [ \ - "$( - ${coreutils}/bin/printf '%s\n' "''${git_status}" | - ${gnused}/bin/sed '/^\s*$/d' | - ${coreutils}/bin/wc -l ; - )" -eq 0 \ - ] ; then + elif [ -z "''${git_status}" ] ; then # Clean repo -> green ${coreutils}/bin/printf 10 ; elif