Moved warning for no fzf to forgit::warn

This commit is contained in:
Christopher Apple 2019-11-05 20:06:45 -07:00
parent 4ab5a2daae
commit 325e98cd03
2 changed files with 7 additions and 7 deletions

View file

@ -1,11 +1,6 @@
#!/usr/local/bin/fish
# MIT (c) Chris Apple
if not hash fzf > /dev/null 2>&1
echo "FZF not found and is requried for forgit"
exit 1
end
function forgit::warn
printf "%b[Warn]%b %s\n" '\e[0;33m' '\e[0m' "$argv" >&2;
end
@ -18,6 +13,11 @@ function forgit::inside_work_tree
git rev-parse --is-inside-work-tree >/dev/null;
end
if not hash fzf > /dev/null 2>&1
forgit::warn "FZF not found and is requried for forgit"
exit 1
end
# https://github.com/so-fancy/diff-so-fancy
hash diff-so-fancy >/dev/null 2>&1 && set forgit_fancy '|diff-so-fancy'
# https://github.com/wfxr/emoji-cli

View file

@ -1,10 +1,10 @@
# MIT (c) Wenxuan Zhang
hash fzf > /dev/null 2>&1 || {echo "FZF not found and is requried for forgit" && return 1}
forgit::warn() { printf "%b[Warn]%b %s\n" '\e[0;33m' '\e[0m' "$@" >&2; }
forgit::info() { printf "%b[Info]%b %s\n" '\e[0;32m' '\e[0m' "$@" >&2; }
forgit::inside_work_tree() { git rev-parse --is-inside-work-tree >/dev/null; }
hash fzf &>/dev/null || {forgit::warn "FZF not found and is requried for forgit" && return 1}
# https://github.com/so-fancy/diff-so-fancy
hash diff-so-fancy &>/dev/null && forgit_fancy='|diff-so-fancy'
# https://github.com/wfxr/emoji-cli