From cf1eaf4c12fc18e03d0c833a769d822c2fdbd336 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Sun, 16 Jun 2024 15:00:30 -0400 Subject: [PATCH] global/git: exit from fzf scripts outside git repository --- users/modules/global/git.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/modules/global/git.nix b/users/modules/global/git.nix index 47c2ee2..a73a8c1 100644 --- a/users/modules/global/git.nix +++ b/users/modules/global/git.nix @@ -7,6 +7,7 @@ git ls-files &> /dev/null if [[ $? -eq 128 ]] then echo "Not in a git repository" + exit 1 elif [[ $# -eq 0 ]] then echo "$(git ls-files | fzf)" else @@ -17,6 +18,7 @@ git ls-files &> /dev/null if [[ $? -eq 128 ]] then echo "Not in a git repository" + exit 1 elif [[ $# -eq 0 ]] then $EDITOR "$(git ls-files | fzf)" else