mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Moved warning for no fzf to forgit::warn
This commit is contained in:
parent
4ab5a2daae
commit
325e98cd03
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue