Skip to content

Commit

Permalink
Revert "Replace available usage with type -q"
Browse files Browse the repository at this point in the history
This reverts commit 6199f40.

I reverted this commit to support fish 2.0.0 properly, since `-q` option
of `type` function was introduced in fish 2.2.0.

See also:
  fish-shell/fish-shell@6f7a745
  fish-shell/fish-shell#1540
  fish-shell/fish-shell#54
  • Loading branch information
simnalamburt committed Oct 28, 2016
1 parent 56177cc commit 67f894c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fish_prompt.fish
Expand Up @@ -236,6 +236,11 @@ function prompt_status -d "the symbols for a non zero exit status, root and back
end
end

# `type -q` equivalent for fish<2.0.0
function available -a name -d "Check if a function or program is available."
type "$name" ^/dev/null >&2
end


#
# Prompt
Expand All @@ -246,8 +251,8 @@ function fish_prompt
prompt_virtual_env
prompt_user
prompt_dir
type -q hg; and prompt_hg
type -q git; and prompt_git
type -q svn; and prompt_svn
available hg; and prompt_hg
available git; and prompt_git
available svn; and prompt_svn
prompt_finish
end

0 comments on commit 67f894c

Please sign in to comment.