fisher/functions/__fisher_list.fish
Jorge Bucaran 5dc1eea953
Ahoy! an early v0.7.0 is here!
+ Add  the ability  to install plugins  from Gists.  You can
distribute a very simple,  one-single function plugin in the
form  of a  Gist. Your  users  can install  it using  fisher
install  url and  Fisherman will  query the  Gist using  the
GitHub API to get a list of  the Gist files and use the name
of the  first identified *.fish  file to name the  plugin in
your system.  Since there is no  formal way to name  a Gist,
and you may  prefer to keep the "description"  field for the
actual description  and not a name,  Fisherman supports only
one fish file per Gist. Closes #75.

+ Use command(1) when calling non-builtins. Thanks @daenney.
Closes #79.

+  Add  __fisher_plugin_can_enable  to detect  installing  a
prompt that is not the current one. Closes #78.

+  Remove  the ability  to  install  a  plugin in  a  parent
directory using ..  or ../ or even worse, ../../  as well as
other combinations  that navigate  to a parent  directory. I
find  the use  case odd  at  best, and  more dangerous  that
useful.  If you  want  to  install a  local  plugin use  the
full  path  or a  relative  path,  always top  down.  fisher
install  . or  fisher  install my/plugin  or fisher  install
/Users/$USER/path/to/plugin. Closes #81.
2016-02-11 09:40:03 +09:00

59 lines
1.5 KiB
Fish

function __fisher_list -a source
switch "$source"
case bare
__fisher_cache_list
case url
for i in (__fisher_cache_list)
__fisher_url_from_path $fisher_cache/$i
end
case "" all cache
set -l enabled (__fisher_list $fisher_file)
set -l legend " "
if test -z "$enabled"
set legend ""
end
for i in (__fisher_cache_list)
if contains -- $i $enabled
if test $i = "$fisher_prompt"
printf "%s%s\n" ">" $i
else if test -L $fisher_cache/$i
printf "%s%s\n" "@" $i
else
printf "%s%s\n" "*" $i
end
else
printf "%s%s\n" "$legend" $i
end
end
case enabled installed
__fisher_list $fisher_file
case disabled
set -l enabled (__fisher_list $fisher_file)
for name in (__fisher_cache_list)
if not contains -- $name $enabled
printf "%s\n" $name
end
end
case theme prompt
printf "%s\n" $fisher_prompt
case -
__fisher_file | __fisher_name
case \*
if test -s "$source"
__fisher_list - < $source
end
end
end