global/git: exit from fzf scripts outside git repository
This commit is contained in:
parent
1f37135b7b
commit
cf1eaf4c12
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue