Ahoy! Fisherman 1.4.0 has shipped.

Notable changes:

+ Now fisher list does not show plugins that are disabled,
  but available in the cache. To preview these items use
  fisher list --disabled.

+ Welcome aboard @orangecms and @xrain0610.

+ Fisherman is now available in AUR, thanks @orangecms.

+ Fix load order during installation. Now snippets can
  safely invoke functions defined in the plugin function
  directory. Thanks @orangecms. #170.

+ Fisherman **installs and updates plugins ⌁concurrently**.
  Performance may vary, but if you can see 5 to 10 times
  faster network times, it's working well.
This commit is contained in:
Jorge Bucaran 2016-03-31 02:42:44 +09:00
parent fca41816e1
commit 6c5cac3a18
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30
43 changed files with 336 additions and 482 deletions

View file

@ -1,14 +1,18 @@
# Change Log # Change Log
## [1.4.0][v140] - Not released yet. ## [1.4.0][v140] - 2016-03-31
* Welcome aboard @orangecms. * :warning: Deprecate --force flag in fisher install.
* Now fisher list does not show plugins that are disabled, but available in the cache. To see these items use fisher list --disabled.
* Welcome aboard @orangecms and @xrain0610.
* Fisherman is now [available](https://aur.archlinux.org/packages/fisherman-git/) in the Arch User Repository. * Fisherman is now [available](https://aur.archlinux.org/packages/fisherman-git/) in the Arch User Repository.
* Fix load order during installation. Now snippets can safely invoke functions defined in the plugin function directory. Thanks @orangecms. #170. * Fix load order during installation. Now snippets can safely invoke functions defined in the plugin function directory. Thanks @orangecms. #170.
* Fisherman updates plugins in **⌁ parallel** now. Performance will vary, but chances are you will perceive 3 to 10 times faster updates. * Fisherman installs and updates plugins in **⌁ parallel** now. Performance will vary, but chances are you will perceive 3 to 10 times faster updates.
![para](https://cloud.githubusercontent.com/assets/8317250/13730493/5b704bec-e994-11e5-81b9-d3af2c0f9821.gif) ![para](https://cloud.githubusercontent.com/assets/8317250/13730493/5b704bec-e994-11e5-81b9-d3af2c0f9821.gif)
@ -18,8 +22,6 @@
fisher list - < file fisher list - < file
``` ```
* Revise documentation.
## [1.3.1][v131] - 2016-03-12 ## [1.3.1][v131] - 2016-03-12
* Fix bug in fisher_config_color_reset not declaring path variable. * Fix bug in fisher_config_color_reset not declaring path variable.

View file

@ -102,8 +102,8 @@ List installed plugins.
fisher list fisher list
debug debug
* fishtape * fishtape
> shellder
* spin * spin
> superman
@ wipe @ wipe
``` ```
@ -119,7 +119,7 @@ fisher search
fzf Efficient keybindings for fzf fzf Efficient keybindings for fzf
get Press any key to continue get Press any key to continue
... ...
> shellder Powerline prompt optimized for speed > superman Powerline prompt based on Superman
... ...
``` ```

View file

@ -1,3 +1,3 @@
function __fisher_cache_list function __fisher_cache_list
find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||' command find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||'
end end

View file

@ -1,7 +0,0 @@
function __fisher_deps_install -a path
for file in $path/{fishfile,bundle}
if test -s $file
fisher_install < $file | sed -En 's|^([0-9]+) plugin/s installed.*|\1|p'
end
end | awk '{ n = n + $0 } END { print n ? n : 0 }'
end

View file

@ -6,8 +6,6 @@ function __fisher_file_remove -a plugin file
set pattern "/^$pattern\$/d" set pattern "/^$pattern\$/d"
end end
debug "File remove %s" "$plugin"
sed -E "$pattern" < $file > $file.tmp sed -E "$pattern" < $file > $file.tmp
command mv $file.tmp $file command mv $file.tmp $file

View file

@ -1,12 +0,0 @@
function __fisher_function_to_plugin -a name
if test -d "$name"
return 1
end
set -l path (pwd)/$name
mkdir -p "$path"
functions -- $name | fish_indent > "$path/$name.fish"
printf "%s\n" "$path"
end

View file

@ -16,7 +16,7 @@ function __fisher_index_update -a timeout
set -l index $fisher_cache/.index.tmp set -l index $fisher_cache/.index.tmp
if test -z "$url" if test -z "$url"
# Force the server to return the latest copy of the index using a fake query string. # force the server to return the latest copy of the index using a fake query string
set url https://raw.githubusercontent.com/fisherman/fisher-index/master/index\?(date +%s) set url https://raw.githubusercontent.com/fisherman/fisher-index/master/index\?(date +%s)
end end

View file

@ -12,7 +12,7 @@ function __fisher_key_bindings_enable -a plugin user_key_bindings
source $user_key_bindings source $user_key_bindings
end end
debug "Bind %s" "$user_key_bindings" debug "binds %s" "$user_key_bindings"
functions fish_user_key_bindings \ functions fish_user_key_bindings \
| __fisher_key_bindings_update_user > $user_key_bindings | __fisher_key_bindings_update_user > $user_key_bindings

View file

@ -3,14 +3,14 @@ function __fisher_path_make -a path
return return
end end
debug "Make %s" "$path/Makefile" debug "make %s" "$path/Makefile"
pushd $path pushd $path
set -e argv[1] set -e argv[1]
if not make $argv if not make $argv
debug "Make fail %s" "$argv" debug "make fail %s" "$argv"
popd popd
return 1 return 1
end end

View file

@ -1,9 +1,4 @@
function __fisher_plugin_can_enable -a name path function __fisher_plugin_can_enable -a name path
# Check whether a plugin is the current prompt or not a prompt. We use this
# method when the user is trying to Update or Uninstall a prompt that is not
# currently enabled, and we wish to skip only the enable / disable phase.
if not __fisher_path_is_prompt $path if not __fisher_path_is_prompt $path
return 0 return 0
end end

View file

@ -2,7 +2,7 @@ function __fisher_plugin_disable -a plugin path option
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name __fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
switch "$class" switch "$class"
case --bind case --bind
debug "Unbind %s" $plugin debug "unbind %s" $plugin
__fisher_key_bindings_disable $plugin (__fisher_xdg --config __fisher_key_bindings_disable $plugin (__fisher_xdg --config
)/fish/functions/fish_user_key_bindings.fish )/fish/functions/fish_user_key_bindings.fish
@ -27,12 +27,11 @@ function __fisher_plugin_disable -a plugin path option
set -l key set -l key
if not set key (fisher_search --name=$plugin --name --index=$fisher_cache/.index) if not set key (fisher_search --name=$plugin --name --index=$fisher_cache/.index)
debug "Path $path"
set key (__fisher_url_from_path $path) set key (__fisher_url_from_path $path)
end end
debug "fishfile remove %s start" "$key" debug "fishfile remove %s start" "$key"
if set key (__fisher_file_remove "$key" "$fisher_file") if set key (__fisher_file_remove "$key" "$fisher_file")
debug "fishfile remove %s ok" "$key" debug "fishfile remove %s ok" "$key"
else else

View file

@ -1,25 +1,21 @@
function __fisher_plugin_enable -a plugin path function __fisher_plugin_enable -a plugin path
debug "Enable %s" "$plugin" debug "enable %s" "$plugin"
if __fisher_path_is_prompt $path if __fisher_path_is_prompt $path
if test ! -z "$fisher_prompt" if test ! -z "$fisher_prompt"
debug "Disable prompt %s" $fisher_prompt debug "disable prompt %s" $fisher_prompt
__fisher_plugin_disable "$fisher_prompt" "$fisher_cache/$fisher_prompt" __fisher_plugin_disable "$fisher_prompt" "$fisher_cache/$fisher_prompt"
end end
set -U fisher_prompt $plugin set -U fisher_prompt $plugin
end end
set -l link -f set -l link -sfF
if test -L $path
set link -sfF
end
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name __fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
switch "$class" switch "$class"
case --bind case --bind
debug "Bind %s" $source debug "bind %s" $source
__fisher_key_bindings_enable $plugin (__fisher_xdg --config __fisher_key_bindings_enable $plugin (__fisher_xdg --config
)/fish/functions/fish_user_key_bindings.fish < $source )/fish/functions/fish_user_key_bindings.fish < $source
@ -33,11 +29,11 @@ function __fisher_plugin_enable -a plugin path
__fisher_plugin_link $link $source $fisher_config/$target __fisher_plugin_link $link $source $fisher_config/$target
if test "$class" = --source if test "$class" = --source
debug "Source %s" "$fisher_config/$target" debug "source %s" "$fisher_config/$target"
__fisher_plugin_source $plugin $fisher_config/$target __fisher_plugin_source $plugin $fisher_config/$target
if test "$name" = set_color_custom if test "$name" = set_color_custom
debug "Colors" debug "color save"
__fisher_config_color_save "$fisher_config/fish_colors" __fisher_config_color_save "$fisher_config/fish_colors"
set_color_custom set_color_custom
end end
@ -53,12 +49,12 @@ function __fisher_plugin_enable -a plugin path
if test -s $fisher_file if test -s $fisher_file
if __fisher_file_contains "$item" --quiet $fisher_file if __fisher_file_contains "$item" --quiet $fisher_file
debug "File skip %s" "$item" debug "file skip %s" "$item"
return return
end end
end end
debug "File add %s" "$item" debug "file add %s" "$item"
printf "%s\n" $item >> $fisher_file printf "%s\n" $item >> $fisher_file
end end

View file

@ -0,0 +1,127 @@
function -S __fisher_plugin_fetch
set -l plugins
set -l fetched
for item in $argv
if not set item (__fisher_plugin_validate "$item")
printf "fisher: '%s' is not a valid plugin\n" "$item" > $stderr
debug "validate fail %s" "$item"
continue
end
debug "validate ok %s" "$item"
if contains -- "$item" $enabled
if test -z "$option"
set skipped $skipped "$item"
debug "skip %s" "$item"
continue
end
end
switch "$item"
case \*/\*
set plugins $plugins "$item"
debug "url or path %s" $item
case \*
if test -d "$fisher_cache/$item"
set -l url (__fisher_url_from_path "$fisher_cache/$item")
if test ! -z "$url"
set plugins $plugins "$url"
end
debug "cache %s" "$item"
else
if test ! -s $fisher_cache/.index
if spin "__fisher_index_update" --error=/dev/null > /dev/null
debug "update index ok"
else
debug "update index fail"
end
end
if set -l url (fisher_search --url --name="$item" --index=$fisher_cache/.index)
set plugins $plugins "$url"
debug "name %s" $item
else
printf "fisher: I couldn't find '%s' in the index\n" $item > $stderr
end
end
end
end
for plugin in $plugins
set -l name (echo $plugin | __fisher_name)
set -l path $fisher_cache/$name
switch "$plugin"
case {https://,}gist.github.com\*
debug "gist %s" $item
if not set name (__fisher_gist_to_name $plugin)
printf "fisher: I could not find your gist\n" > $stderr
continue
end
end
printf "%s\n" "$name"
debug "plugin %s" "$name"
if test ! -e $path
if not set -q __fisher_fetch_status
set -g __fisher_fetch_status
printf "Installing plugin/s\n" > $stderr
else if test "$__fisher_fetch_status" = "deep"
printf "Installing dependencies\n" > $stderr
set -g __fisher_fetch_status done
end
set fetched $fetched "$path"
if test -d "$plugin"
debug "link %s" "$plugin"
command ln -sfF $plugin $path
else
debug "clone %s" "$plugin"
fish -ic "
spin '
if __fisher_url_clone $plugin $path
printf \" %-20s\n\" \"$name\"
end
' > $stderr
" &
end
end
end
if test ! -z "$plugins"
while true
set -l has_jobs (jobs)
if test -z "$has_jobs"
break
end
end
end
switch "$__fisher_fetch_status"
case done deep
case \*
set __fisher_fetch_status deep
end
for path in $fetched
for file in $path/{fishfile,bundle}
if test -s $file
__fisher_plugin_fetch (__fisher_file < $file)
end
end
end
set -e __fisher_fetch_status
end

View file

@ -1,4 +1,4 @@
function __fisher_plugin_link -a options source target function __fisher_plugin_link -a options source target
debug "Link %s" $target debug "link %s" $target
command ln $options $source $target command ln $options $source $target
end end

View file

@ -1,9 +1,9 @@
function __fisher_plugin_unlink -a file name function __fisher_plugin_unlink -a file name
debug "Unlink %s" $file debug "unlink %s" $file
command rm -f $file command rm -f $file
if test ! -z "$name" if test ! -z "$name"
debug "Erase %s" $name debug "erase %s" $name
functions -e $name functions -e $name
end end
end end

View file

@ -1,4 +1,8 @@
function __fisher_plugin_validate -a plugin function __fisher_plugin_validate -a plugin
if test -z "$plugin"
return 1
end
if set -q argv[2] if set -q argv[2]
printf "%s\n" "$argv" printf "%s\n" "$argv"
return 1 return 1

View file

@ -1,11 +1,11 @@
function __fisher_plugin_walk -a plugin path function __fisher_plugin_walk -a plugin path
debug "Walk %s" "$path" debug "walk %s" "$path"
for file in $path/{functions/**,*,{conf.d,modules}/*}.{fish,load} $path/completions/*.fish for file in $path/{functions/**,*,{conf.d,modules}/*}.{fish,load} $path/completions/*.fish
set -l name (basename $file .fish) set -l name (basename $file .fish)
set -l base $name.fish set -l base $name.fish
debug "File %s" $file debug "file %s" $file
switch $file switch $file
case \*/{fish_user_,}key_bindings.fish case \*/{fish_user_,}key_bindings.fish
@ -41,14 +41,14 @@ function __fisher_plugin_walk -a plugin path
set -l prefix functions set -l prefix functions
set -l target $prefix/(basename $file) set -l target $prefix/(basename $file)
debug "Script %s" $target debug "script %s" $target
printf "%s %s %s\n" -- $file $target printf "%s %s %s\n" -- $file $target
end end
for n in (seq 9) for n in (seq 9)
for file in $path/man/man$n/*.$n for file in $path/man/man$n/*.$n
debug "Man %s" $file debug "man$n %s" $file
printf "%s %s %s\n" --man $file man/man$n/(basename $file) printf "%s %s %s\n" --man $file man/man$n/(basename $file)
end end

View file

@ -1,16 +1,11 @@
function __fisher_prompt_reset function __fisher_prompt_reset
set -U fisher_prompt set -U fisher_prompt
# To reset the prompt, remove any data in fisher_prompt and source any existing
# fish_prompt file as follows. First, look inside functions/ inside each of the
# given paths. If none are given, look in the user fish configuration. If none
# is found, source the default prompt inside __fish_datadir/functions.
set argv $argv (__fisher_xdg --config)/fish $__fish_datadir set argv $argv (__fisher_xdg --config)/fish $__fish_datadir
for prompt in $argv/functions/fish_prompt.fish for prompt in $argv/functions/fish_prompt.fish
if test -s $prompt if test -s $prompt
debug "Reset prompt %s" $prompt debug "reset prompt %s" $prompt
source $prompt source $prompt
return return

View file

@ -1,4 +1,4 @@
function __fisher_url_clone -a url path function __fisher_url_clone -a url path
set -lx GIT_ASKPASS /bin/echo set -lx GIT_ASKPASS /bin/echo
git clone -q --depth 1 $url $path git clone -q --depth 1 $url $path
end end

View file

@ -17,7 +17,7 @@ function fish_config -d "Launch fish's web based configuration" -a tab
debug "fish_prompt check sum after: %s" $sum_after debug "fish_prompt check sum after: %s" $sum_after
if test "$sum_before" != "$sum_after" if test "$sum_before" != "$sum_after"
debug "Uninstall %s" "$fisher_prompt" debug "uninstall %s" "$fisher_prompt"
fisher_uninstall "$fisher_prompt" -q fisher_uninstall "$fisher_prompt" -q
end end
end end

View file

@ -1,4 +1,4 @@
function fisher -d "Fish plugin manager" function fisher -d "fish plugin manager"
set -l value set -l value
set -l option help set -l option help
@ -17,7 +17,7 @@ function fisher -d "Fish plugin manager"
set option version set option version
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher -h > /dev/stderr fisher -h > /dev/stderr
return 1 return 1
end end
@ -26,7 +26,7 @@ function fisher -d "Fish plugin manager"
switch "$option" switch "$option"
case command case command
set -l IFS = set -l IFS =
set -l default_alias install=i update=u search=s list=l help=h new=n set -l default_alias install=i update=u search=s list=l help=h new=n uninstall=r
printf "%s\n" $fisher_alias $default_alias | while read -l command alias printf "%s\n" $fisher_alias $default_alias | while read -l command alias
if test "$value" = "$alias" if test "$value" = "$alias"
@ -62,19 +62,8 @@ function fisher -d "Fish plugin manager"
printf "Commands:\n" printf "Commands:\n"
__fisher_help_commands | sed " __fisher_help_commands | sed "
s/^/ / s/^/ /
s/;/"\t" / s/;/"\t" /
" | column -ts\t
" | column -ts\t | sed -E "
s/^ (h)(elp)/ $color\1$color_normal\2/
s/^ (i)(nstall)/ $color\1$color_normal\2/
s/^ (s)(earch)/ $color\1$color_normal\2/
s/^ (u)(pdate)/ $color\1$color_normal\2/
s/^ (l)(ist)/ $color\1$color_normal\2/
s/^ (n)(ew)/ $color\1$color_normal\2/
"
printf "\nUse fisher help <command> to get help.\n"
end end
end end

View file

@ -1,4 +1,4 @@
function fisher_help -d "Show command help" function fisher_help -d "Show command help (h)"
if not set -q argv[1] if not set -q argv[1]
man fisher man fisher
return return
@ -22,7 +22,7 @@ function fisher_help -d "Show command help"
return return
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher_help -h > /dev/stderr fisher_help -h > /dev/stderr
return 1 return 1
end end

View file

@ -1,168 +1,54 @@
function fisher_install -d "Install plugins" function fisher_install -d "Install plugins (i)"
set -l plugins set -l items
set -l option set -l option
set -l stdout /dev/stdout set -l stdout /dev/stdout
set -l stderr /dev/stderr set -l stderr /dev/stderr
set -l color (set_color $fish_color_match)
set -l color_normal (set_color normal)
getopts $argv | while read -l 1 2 getopts $argv | while read -l 1 2
switch "$1" switch "$1"
case _ case _
set plugins $plugins $2 set items $items $2
case f force
set option force
if test ! -z "$2"
set plugins $plugins $2
end
case C no-color
set color
set color_normal
case q quiet case q quiet
set stdout /dev/null set stdout /dev/null
set stderr /dev/null set stderr /dev/null
case h case h
printf "Usage: fisher install [<plugins>] [--force] [--quiet] [--help]\n\n" printf "Usage: fisher install [<plugins>] [--quiet] [--help]\n\n"
printf " -f --force Reinstall given plugin/s\n"
printf " -q --quiet Enable quiet mode\n" printf " -q --quiet Enable quiet mode\n"
printf " -C --no-color Turn off color display\n"
printf " -h --help Show usage help\n" printf " -h --help Show usage help\n"
return return
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher_install -h > /dev/stderr fisher_install -h > /dev/stderr
return 1 return 1
end end
end end
set -l link command mkdir -p $fisher_cache $fisher_config/{functions,completions,conf.d,man}
set -l time (date +%s) set -l time (date +%s)
set -l count 0 set -l count 0
set -l index 1 set -l index 1
set -l total (count $plugins)
set -l skipped set -l skipped
set -l indicator "▸" set -l enabled (fisher_list --enabled)
set -l IFS \t if test -z "$items"
__fisher_file | read -az items
end
if set -q plugins[1] set -l plugins (__fisher_plugin_fetch $items | awk '!seen[$0]++')
printf "%s\n" $plugins
else
__fisher_file
end | while read -l item for plugin in $plugins
debug "Validate %s" $item set -l path $fisher_cache/$plugin
if not set item (__fisher_plugin_validate $item) if test -d $path
debug "Validate fail %s" $item __fisher_path_make "$path" --quiet
printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr __fisher_plugin_enable "$plugin" "$path"
continue
set count (math $count + 1)
end end
debug "Validate ok %s" $item
switch "$item"
case https://gist.github.com\*
debug "Gist %s" $item
if set -l name (__fisher_gist_to_name $item )
printf "%s\t%s\n" $item $name
else
printf "fisher: Repository '%s' not found.\n" $item > $stderr
end
case \*/\*
debug "URL or path %s" $item
printf "%s\t%s\n" "$item" (printf "%s\n" "$item" | __fisher_name)
case \*
if test -d $fisher_cache/$item
debug "Cache %s" \$fisher_cache/$item
printf "%s\t%s\n" (__fisher_url_from_path $fisher_cache/$item) $item
else
if test ! -s $fisher_cache/.index
if spin "__fisher_index_update" --error=/dev/null > /dev/null
debug "Update index ok"
else
debug "Update index fail"
end
end
if set -l url (fisher_search --url --name=$item --index=$fisher_cache/.index)
debug "Index %s" $item
printf "%s\t%s\n" $url $item
else if functions -q "$item"
set -l path
if set path (__fisher_function_to_plugin $item)
printf "%s\t%s" "$path" $item
else
printf "fisher: '%s' is a directory in %s.\n" $item $PWD > $stderr
end
else
printf "fisher: I couldn't find '%s' in the index.\n" $item > $stderr
end
end
end
end | while read -l url name
if contains -- $name (fisher_list --enabled)
if test -z "$option"
set skipped $skipped $name
continue
end
end
printf "$indicator Installing " > $stderr
switch $total
case 0 1
printf "%s\n" $name > $stderr
case \*
printf "(%s of %s) %s\n" $index $total $name > $stderr
set index (math $index + 1)
end
command mkdir -p $fisher_config/{functions,completions,conf.d,man} $fisher_cache
set -l path $fisher_cache/$name
if test ! -e $path
if test -d "$url"
debug "Link %s" $url
command ln -sfF $url $path
else
debug "Clone %s" $url
if not spin "__fisher_url_clone $url $path" --error=$stderr -f " $color@\r$color_normal"
continue
end
end
end
set -l deps (__fisher_deps_install "$path")
if test "$deps" -gt 0
debug "Install deps ok"
end
if not __fisher_path_make "$path" --quiet
continue
end
__fisher_plugin_enable "$name" "$path"
set count (math $count + 1 + "0$deps")
end end
set time (math (date +%s) - $time) set time (math (date +%s) - $time)
@ -173,16 +59,14 @@ function fisher_install -d "Install plugins"
end end
if test "$count" -le 0 if test "$count" -le 0
printf "No plugins were installed.\n" > $stdout printf "No plugins were installed\n" > $stdout
return 1 return 1
end end
debug "Reset completions and key bindings start"
__fisher_complete_reset __fisher_complete_reset
__fisher_key_bindings_reset __fisher_key_bindings_reset
debug "Reset completions and key bindings ok" debug "complete and key binds reset"
printf "%d plugin/s installed in %0.fs\n" $count $time > $stdout printf "%d plugin/s installed (%0.fs)\n" $count $time > $stdout
end end

View file

@ -1,4 +1,4 @@
function fisher_list -a key -d "List installed plugins" function fisher_list -a key -d "List installed plugins (l)"
set -l enabled set -l enabled
if test -f "$fisher_file" if test -f "$fisher_file"
@ -7,37 +7,31 @@ function fisher_list -a key -d "List installed plugins"
switch "$key" switch "$key"
case "" case ""
set -l cache (__fisher_cache_list) set -l indent
set -l links (command find $fisher_cache/* -maxdepth 0 -type l ^ /dev/null | sed 's|.*/||')
if test -z "$cache" if test ! -z "$fisher_prompt"
return 1 set indent " "
end end
set -l indent " " for plugin in $links
if contains -- "$plugin" $enabled
if test -z "$enabled" set indent " "
set indent "" break
end
for i in $cache
if contains -- $i $enabled
if test $i = "$fisher_prompt"
printf "%s%s\n" ">$indent" $i
else if test -L $fisher_cache/$i
printf "%s%s\n" "@$indent" $i
else
printf "%s%s\n" "*$indent" $i
end
else
printf "%s%s\n" "$indent$indent" $i
end end
end end
case -l --link for plugin in $enabled
find $fisher_cache/* -maxdepth 0 -type l ^ /dev/null | sed 's|.*/||' if contains -- "$plugin" $links
printf "%s %s\n" "@" $plugin
else if test $plugin = "$fisher_prompt"
printf "%s %s\n" ">" $plugin
else
printf "$indent$indent%s\n" $plugin
end
end
case --enabled case --enabled
if test ! -z "$enabled" if test ! -z "$enabled"
@ -55,8 +49,7 @@ function fisher_list -a key -d "List installed plugins"
__fisher_list __fisher_list
case -h case -h
printf "Usage: fisher list [--enabled] [--disabled] [--link]\n\n" printf "Usage: fisher list [--enabled] [--disabled] [--help]\n\n"
printf " -l --link List plugins that are symbolic links\n"
printf " --enabled List plugins that are enabled\n" printf " --enabled List plugins that are enabled\n"
printf " --disabled List plugins that are disabled\n" printf " --disabled List plugins that are disabled\n"
printf " -h --help Show usage help\n" printf " -h --help Show usage help\n"

View file

@ -1,4 +1,4 @@
function fisher_search -d "Search plugin index" function fisher_search -d "Search plugin index (s)"
set -l fields set -l fields
set -l query set -l query
set -l index set -l index
@ -6,7 +6,7 @@ function fisher_search -d "Search plugin index"
set -l format set -l format
set -l option set -l option
set -l stdout /dev/stdout set -l stdout /dev/stdout
set -l color (set_color $fish_color_match) set -l color (set_color $fish_color_quote)
set -l color_normal (set_color normal) set -l color_normal (set_color normal)
getopts $argv | while read -l 1 2 3 getopts $argv | while read -l 1 2 3
@ -87,7 +87,7 @@ function fisher_search -d "Search plugin index"
return return
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher_search -h > /dev/stderr fisher_search -h > /dev/stderr
return 1 return 1
end end
@ -105,7 +105,7 @@ function fisher_search -d "Search plugin index"
if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index
debug "Update index start" debug "Update index start"
if spin "__fisher_index_update" --error=/dev/null -f " $color@$color_normal\r" > /dev/null if spin "__fisher_index_update" --error=/dev/null > /dev/null
debug "Update index ok" debug "Update index ok"
__fisher_complete_reset __fisher_complete_reset
else else
@ -132,9 +132,9 @@ function fisher_search -d "Search plugin index"
end end
end end
set -l color_name (set_color $fish_color_command -o) set -l color_name (set_color $fish_color_quote)
set -l color_url (set_color $fish_color_quote -u) set -l color_url (set_color $fish_color_end -u)
set -l color_tag (set_color $fish_color_quote) set -l color_tag (set_color $fish_color_command)
set -l color_weak (set_color white -o) set -l color_weak (set_color white -o)
set -l color_author (set_color -u) set -l color_author (set_color -u)
set -l color_normal (set_color $fish_color_normal) set -l color_normal (set_color $fish_color_normal)

View file

@ -1,4 +1,4 @@
function fisher_uninstall -d "Uninstall plugins" function fisher_uninstall -d "Uninstall plugins (r)"
set -l plugins set -l plugins
set -l option set -l option
set -l stdout /dev/stdout set -l stdout /dev/stdout
@ -28,74 +28,63 @@ function fisher_uninstall -d "Uninstall plugins"
return return
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher_uninstall -h > /dev/stderr fisher_uninstall -h > /dev/stderr
return 1 return 1
end end
end end
set -l time (date +%s)
set -l count 0 set -l count 0
set -l index 1
set -l total (count $plugins)
set -l skipped set -l skipped
set -l indicator "▸" set -l time (date +%s)
set -l IFS \t set -l IFS \t
printf "Uninstalling\n" > $stderr
if set -q plugins[1] if set -q plugins[1]
printf "%s\n" $plugins printf "%s\n" $plugins
else else
__fisher_file __fisher_file
end | while read -l item path end | while read -l item path
debug "Validate %s" $item debug "validate %s" $item
if not set item (__fisher_plugin_validate $item) if not set item (__fisher_plugin_validate $item)
debug "Validate fail %s" $item debug "validate fail %s" $item
printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr printf "fisher: '%s' is not a valid plugin\n" $item > $stderr
continue continue
end end
debug "Validate ok %s" $item debug "validate ok %s" $item
if not set path (__fisher_path_from_plugin $item) if not set path (__fisher_path_from_plugin $item)
printf "fisher: '%s' not found\n" $item > $stderr printf "fisher: I could not find '%s'\n" $item > $stderr
continue continue
end end
set -l name (printf "%s\n" $path | __fisher_name) set -l name (printf "%s\n" $path | __fisher_name)
debug "Uninstall %s" "$name"
if not contains -- $name (fisher_list --enabled) if not contains -- $name (fisher_list --enabled)
if test -z "$option" if test -z "$option"
debug "skip %s" "$name"
set skipped $skipped $name set skipped $skipped $name
continue continue
end end
end end
printf "$indicator Uninstalling " > $stderr printf " %-22s\n" "$name" > $stdout
debug "uninstall %s" "$name"
switch $total
case 0 1
printf "%s\n" $name > $stderr
case \*
printf "(%s of %s) %s\n" $index $total $name > $stderr
set index (math $index + 1)
end
if __fisher_plugin_can_enable "$name" "$path" if __fisher_plugin_can_enable "$name" "$path"
debug "Disable %s[:%s]" "$name" "$option"
__fisher_plugin_disable "$name" "$path" "$option" __fisher_plugin_disable "$name" "$path" "$option"
else debug "disable %s[:%s]" "$name" "$option"
debug "Disable skip %s" "$name"
end end
if test "$option" = force if test "$option" = force
debug "Delete %s" "$path"
command rm -rf $path command rm -rf $path
debug "remove %s" "$path"
end end
set count (math $count + 1) set count (math $count + 1)
@ -106,20 +95,18 @@ function fisher_uninstall -d "Uninstall plugins"
if test ! -z "$skipped" if test ! -z "$skipped"
printf "%s plugin/s skipped (%s)\n" (count $skipped) ( printf "%s plugin/s skipped (%s)\n" (count $skipped) (
printf "%s\n" $skipped | paste -sd ' ' - printf "%s\n" $skipped | paste -sd ' ' -
) > $stdout ) > $stderr
end end
if test $count -le 0 if test $count -le 0
printf "No plugins were uninstalled.\n" > $stdout printf "No plugins were uninstalled\n" > $stderr
return 1 return 1
end end
debug "Reset completions and key bindings start"
__fisher_complete_reset __fisher_complete_reset
__fisher_key_bindings_reset __fisher_key_bindings_reset
debug "Reset completions and key bindings ok" debug "complete / key bindings reset"
printf "%d plugin/s uninstalled in %0.fs\n" $count $time > $stdout printf "%d plugin/s uninstalled in %0.fs\n" $count $time > $stderr
end end

View file

@ -1,9 +1,9 @@
function fisher_update -d "Update plugins" function fisher_update -d "Update plugins (u)"
set -l items set -l items
set -l plugins set -l plugins
set -l enabled (fisher_list --enabled)
set -l stdout /dev/stdout set -l stdout /dev/stdout
set -l stderr /dev/stderr set -l stderr /dev/stderr
set -l indicator "▸"
getopts $argv | while read -l 1 2 getopts $argv | while read -l 1 2
switch "$1" switch "$1"
@ -21,7 +21,7 @@ function fisher_update -d "Update plugins"
return return
case \* case \*
printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr printf "fisher: '%s' is not a valid option\n" $1 > /dev/stderr
fisher_update -h > /dev/stderr fisher_update -h > /dev/stderr
return 1 return 1
end end
@ -39,53 +39,55 @@ function fisher_update -d "Update plugins"
set -l time (date +%s) set -l time (date +%s)
set -l previous_version (cat $fisher_home/VERSION) set -l previous_version (cat $fisher_home/VERSION)
debug "Update %s" $fisher_cache/.index debug "update %s" $fisher_cache/.index
debug "Update %s" $fisher_home debug "update %s" $fisher_home
if not spin "__fisher_index_update 0" --error=$stderr if not spin "__fisher_index_update 0" --error=$stderr
debug "Update Index fail" debug "update index fail"
end end
if not spin "__fisher_path_update $fisher_home" --error=$stderr if not spin "__fisher_path_update $fisher_home" --error=$stderr
debug "Update Fisherman fail" debug "update fisherman fail"
printf "fisher: I couldn't update Fisherman.\n\n" > $stderr printf "fisher: I couldn't update Fisherman\n\n" > $stderr
return 1 return 1
end end
debug "Update Fisherman ok" debug "update fisherman ok"
set -l new_version (cat $fisher_home/VERSION) set -l new_version (cat $fisher_home/VERSION)
if test "$new_version" != "$previous_version" if test "$new_version" != "$previous_version"
printf "$indicator Aye! Fisherman updated from %s to %s (%0.fs)\n" \ printf "Aye! Fisherman updated from %s to %s (%0.fs)\n" \
"$previous_version" "$new_version" (math (date +%s) - $time) > $stderr "$previous_version" "$new_version" (math (date +%s) - $time) > $stderr
else else
printf "$indicator Aye! Fisherman is up to date\n" $time > $stderr printf "Aye! Fisherman is up to date\n" $time > $stderr
end end
set items (fisher_list --enabled) set items $enabled
end end
for item in $items for item in $items
debug "Validate %s" $item if not contains -- $item $enabled
printf "fisher: I couldn't find '%s'\n" $item > $stderr
continue
end
if not set item (__fisher_plugin_validate $item) if not set item (__fisher_plugin_validate $item)
debug "Validate fail %s" $item printf "fisher: '%s' is not a valid plugin\n" $item > $stderr
printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr debug "validate fail %s" $item
continue continue
end end
set -l path (__fisher_path_from_plugin $item) set -l path (__fisher_path_from_plugin $item)
if test -z "$path" if test -z "$path"
printf "fisher: Plugin '%s' is not installed.\n" $item > $stderr printf "fisher: I could not find '%s'\n" $item > $stderr
continue continue
end end
debug "Validate ok %s" $item
set plugins $plugins $path set plugins $plugins $path
debug "validate ok %s" $item
end end
set -l time (date +%s) set -l time (date +%s)
@ -94,21 +96,22 @@ function fisher_update -d "Update plugins"
if set -q plugins[1] if set -q plugins[1]
if test "$total" -gt 0 if test "$total" -gt 0
printf "$indicator Updating %d plugin/s\n" $total > $stderr printf "Updating %d plugin/s\n" $total > $stderr
end end
for path in $plugins for path in $plugins
set -l name (printf "%s\n" $path | __fisher_name) set -l name (printf "%s\n" $path | __fisher_name)
if test ! -L $path if test ! -L $path
debug "Update start %s" "$name" debug "update %s" "$name"
fish -ic " fish -ic "
spin ' spin '
if set -l ahead (__fisher_path_update $path) if set -l ahead (__fisher_path_update $path)
set fisher_updated_plugins \$fisher_updated_plugins $name set fisher_updated_plugins \$fisher_updated_plugins $name
printf \" %-22s %-10s\n\" \"$name\" \"\$ahead new commit/s\" printf \" %-22s %-10s\n\" \"$name\" \"\$ahead new commit/s\"
else else
printf \" %-22s %-10s\n\" \"$name\" \"Up to date\" printf \" %-22s %-10s\n\" \"$name\" \"Up to date\"
end end
' '
@ -127,13 +130,13 @@ function fisher_update -d "Update plugins"
set -l path (__fisher_path_from_plugin "$plugin") set -l path (__fisher_path_from_plugin "$plugin")
if __fisher_plugin_can_enable "$plugin" "$path" if __fisher_plugin_can_enable "$plugin" "$path"
debug "Enable %s" "$plugin"
__fisher_plugin_enable "$plugin" "$path" __fisher_plugin_enable "$plugin" "$path"
debug "enable %s" "$plugin"
end end
end end
if test -z "$fisher_updated_plugins" if test -z "$fisher_updated_plugins"
printf "No plugins were updated.\n" > $stdout printf "No plugins were updated\n" > $stdout
set -e fisher_updated_plugins set -e fisher_updated_plugins
return return
end end
@ -141,13 +144,14 @@ function fisher_update -d "Update plugins"
set time (math (date +%s) - $time) set time (math (date +%s) - $time)
printf "%d plugin/s updated in %0.fs\n" (count $fisher_updated_plugins) $time > $stdout if test ! -z "$fisher_updated_plugins" -a "$fisher_updated_plugins" -ne 0
set -e fisher_updated_plugins printf "%d plugin/s up to date (%0.fs)\n" (count $fisher_updated_plugins) $time > $stdout
debug "Reset completions and key bindings start" set -e fisher_updated_plugins
__fisher_complete_reset __fisher_complete_reset
__fisher_key_bindings_reset __fisher_key_bindings_reset
debug "Reset completions and key bindings ok" debug "complete and key binds reset"
end
end end

View file

@ -145,7 +145,7 @@ Install plugins from multiple sources\.
. .
.nf .nf
fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin fisher install fishtape superman ~/plugins/my_plugin
. .
.fi .fi
. .
@ -155,4 +155,3 @@ fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin
fisher help uninstall fisher help uninstall
. .
.br .br

View file

@ -3,7 +3,7 @@ fisher-install(1) -- Install plugins
## SYNOPSIS ## SYNOPSIS
fisher install [*plugins* ...] [--force] [--quiet] [--help] fisher install [*plugins* ...] [--quiet] [--help]
## USAGE ## USAGE
@ -11,11 +11,10 @@ fisher install *url*<br>
fisher install *name*<br> fisher install *name*<br>
fisher install *path* <br> fisher install *path* <br>
fisher install *owner/repo*<br> fisher install *owner/repo*<br>
fisher install *function*<br>
## DESCRIPTION ## DESCRIPTION
Install one or more plugins, by name, URL, path or function name. If no arguments are given, read the standard input. Install one or more plugins. If no arguments are given, read the standard input.
In addition, all of the following owner/repo variations are accepted: In addition, all of the following owner/repo variations are accepted:
@ -39,9 +38,6 @@ If a plugin includes either a fish_prompt.fish or fish_right_prompt.fish, both f
## OPTIONS ## OPTIONS
* -f, --force:
Reinstall given plugin/s.
* -q, --quiet: * -q, --quiet:
Enable quiet mode. Enable quiet mode.
@ -93,7 +89,7 @@ Snippets are plugins that run code at the start of the shell. Snippets must be p
* Install plugins from multiple sources. * Install plugins from multiple sources.
```fish ```fish
fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin fisher install fishtape superman ~/plugins/my_plugin
``` ```
## SEE ALSO ## SEE ALSO

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "FISHER\-LIST" "1" "February 2016" "" "fisherman" .TH "FISHER\-LIST" "1" "March 2016" "" "fisherman"
. .
.SH "NAME" .SH "NAME"
\fBfisher\-list\fR \- List installed plugins \fBfisher\-list\fR \- List installed plugins
@ -27,8 +27,8 @@ The list command displays all the plugins you have installed\.
fisher list fisher list
debug debug
* fishtape * fishtape
> shellder
* spin * spin
> superman
@ wipe @ wipe
. .
.fi .fi
@ -39,7 +39,7 @@ fisher list
The legend consists of: The legend consists of:
. .
.P .P
\fB*\fR Indicate the plugin is currently installed \fB*\fR Indicate the plugin is installed
. .
.br .br
\fB>\fR Indicate the plugin is a prompt \fB>\fR Indicate the plugin is a prompt

View file

@ -4,7 +4,7 @@ fisher-list(1) -- List installed plugins
## SYNOPSIS ## SYNOPSIS
fisher list [*file*]<br> fisher list [*file*]<br>
fisher list [--bare] [--link] [--enabled] [--disabled] [--help]<br> fisher list [--enabled] [--disabled] [--help]<br>
## USAGE ## USAGE
@ -12,39 +12,32 @@ fisher list [*file*]
## DESCRIPTION ## DESCRIPTION
The list command displays all the plugins you have installed. The list command displays all the plugins that are currently installed.
``` ```
fisher list fisher list
debug debug
* fishtape fishtape
> shellder spin
* spin > superman
@ wipe @ wipe
``` ```
The legend consists of: The legend consists of:
`*` Indicate the plugin is currently installed<br>
`>` Indicate the plugin is a prompt<br> `>` Indicate the plugin is a prompt<br>
`@` Indicate the plugin is a symbolic link<br> `@` Indicate the plugin is a symbolic link<br>
## OPTIONS ## OPTIONS
* -b, --bare:
List plugin without decorators
* -l, --link:
List plugins that are symbolic links
* --enabled: * --enabled:
List plugins that are enabled List plugins that are enabled.
* --disabled: * --disabled:
List plugins that are disabled List plugins that are not installed, but available in the cache.
* -h, --help: * -h, --help:
Show usage help Show usage help.
## SEE ALSO ## SEE ALSO

View file

@ -53,7 +53,7 @@ fisher search
fzf Efficient keybindings for fzf fzf Efficient keybindings for fzf
get Press any key to continue get Press any key to continue
\.\.\. \.\.\.
> shellder Powerline prompt optimized for speed > superman Powerline prompt based on Superman
\.\.\. \.\.\.
. .
.fi .fi
@ -67,10 +67,10 @@ Get detailed information about a plugin\.
. .
.nf .nf
fisher search shellder fisher search superman
> shellder by simnalamburt > superman by bucaran
Powerline prompt optimized for speed Powerline prompt based on Superman
github\.com/simnalamburt/shellder github\.com/fishery/superman
. .
.fi .fi
. .
@ -224,4 +224,3 @@ fisher search \-\-name!~/^s/
.fi .fi
. .
.IP "" 0 .IP "" 0

View file

@ -30,17 +30,17 @@ fisher search
fzf Efficient keybindings for fzf fzf Efficient keybindings for fzf
get Press any key to continue get Press any key to continue
... ...
> shellder Powerline prompt optimized for speed > superman Powerline prompt based on Superman
... ...
``` ```
Get detailed information about a plugin. Get detailed information about a plugin.
``` ```
fisher search shellder fisher search superman
> shellder by simnalamburt > superman by bucaran
Powerline prompt optimized for speed Powerline prompt based on Superman
github.com/simnalamburt/shellder github.com/fishery/superman
``` ```
Search plugins using tags. Search plugins using tags.

View file

@ -15,11 +15,11 @@ fisher uninstall *owner/repo*<br>
## DESCRIPTION ## DESCRIPTION
Uninstall one or more plugins, by name, URL or path. If no arguments are given, read the standard input. This process is the inverse of Install. Uninstall one or more plugins. If no arguments are given, read the standard input.
Uninstall does not remove any copies of the given plugin in $fisher_cache. To erase the copy from the cache, use the --force option. Uninstall does not remove any copies of the given plugin in $fisher_cache. To erase the copy from the cache, use the --force option.
Uninstall does not remove any dependencies installed with other plugins. This behavior prevents breaking plugins that share the same dependency. Uninstall does not remove any dependencies installed with other plugins.
## OPTIONS ## OPTIONS
@ -34,10 +34,10 @@ Uninstall does not remove any dependencies installed with other plugins. This be
## EXAMPLES ## EXAMPLES
* Uninstall all plugins and flush the cache. * Uninstall all plugins flushing the cache.
```fish ```fish
fisher --list | fisher uninstall --force fisher list | fisher uninstall --force
``` ```
## SEE ALSO ## SEE ALSO

View file

@ -14,9 +14,7 @@ fisher update *owner/repo* ...<br>
## DESCRIPTION ## DESCRIPTION
Update one or more plugins, by name, URL or path. If no arguments are given, update Fisherman to the latest release. If you try to update a plugin that is currently disabled, but exists in the cache, it will be updated and then enabled. Use a dash `-` to read from the standard input. Update one or more plugins concurrently. If no arguments are given, update everything, including Fisherman. Use a dash `-` to read from the standard input.
If a plugin is missing dependencies, they will be installed. If any dependencies are already installed they will not be updated.
## OPTIONS ## OPTIONS
@ -39,9 +37,3 @@ fisher update
```fish ```fish
fisher list | fisher update - fisher list | fisher update -
``` ```
* Update all the plugins in the cache concurrently.
```fish
fisher list --bare | xargs -n1 -P0 fish -c "fisher update -"
```

View file

@ -203,7 +203,7 @@ List installed plugins\.
fisher list fisher list
debug debug
* fishtape * fishtape
> shellder > superman
* spin * spin
@ wipe @ wipe
. .
@ -227,7 +227,7 @@ fisher search
fzf Efficient keybindings for fzf fzf Efficient keybindings for fzf
get Press any key to continue get Press any key to continue
\.\.\. \.\.\.
> shellder Powerline prompt optimized for speed > superman Powerline prompt based on Superman
\.\.\. \.\.\.
. .
.fi .fi

View file

@ -1,4 +1,4 @@
fisher(1) -- Fish plugin manager fisher(1) -- fish plugin manager
================================ ================================
## SYNOPSIS ## SYNOPSIS
@ -9,7 +9,7 @@ fisher *command* [*options*] [--version] [--help]<br>
Fisherman is a plugin manager for fish. Fisherman is a plugin manager for fish.
The Fisherman CLI consists of: *install*, *update*, *uninstall*, *list*, *search* and *help* and the following aliases: *i* for install, *u* for update, *l* for list, *s* for search and *h* for help. The Fisherman CLI consists of: *install*, *update*, *uninstall*, *list*, *search* and *help* and the following aliases: *i* for install, *u* for update, *l* for list, *s* for search, *r* for uninstall and *h* for help.
## USAGE ## USAGE
@ -41,7 +41,7 @@ fisher help <command>
fisher i fishtape shark get bobthefish fisher i fishtape shark get bobthefish
``` ```
* Install Oh My Fish! plugins. * Install oh-my-fish plugins.
```fish ```fish
fisher i omf/plugin-{percol,jump,fasd} fisher i omf/plugin-{percol,jump,fasd}
@ -59,7 +59,7 @@ fisher i ./path/to/plugin
fisher i https://github.com/some/plugin another/plugin bb:one/more fisher i https://github.com/some/plugin another/plugin bb:one/more
``` ```
* Install a plugin from a Gist. * Install a plugin from a gist.
```fish ```fish
fisher i gist.github.com/owner/1f40e1c6e0551b2666b2 fisher i gist.github.com/owner/1f40e1c6e0551b2666b2
@ -98,10 +98,10 @@ List installed plugins.
``` ```
fisher list fisher list
debug debug
* fishtape fishtape
> shellder spin
* spin > superman
@ wipe @ my_aliases
``` ```
Search the index. Search the index.
@ -116,7 +116,7 @@ fisher search
fzf Efficient keybindings for fzf fzf Efficient keybindings for fzf
get Press any key to continue get Press any key to continue
... ...
> shellder Powerline prompt optimized for speed > superman Powerline prompt optimized for speed
... ...
``` ```
@ -138,19 +138,19 @@ Search using tags.
fisher search --tag={git,test} fisher search --tag={git,test}
... ...
* fishtape TAP producing test runner * fishtape TAP producing test runner
git-branch-name Get the name of the current Git branch git-branch-name Get the name of the current Git branch
git-is-dirty Test if there are changes not staged for commit git-is-dirty Test if there are changes not staged for commit
git-is-empty Test if a repository is empty git-is-empty Test if a repository is empty
git-is-repo Test if the current directory is a Git repo git-is-repo Test if the current directory is a Git repo
git-is-staged Test if there are changes staged for commit git-is-staged Test if there are changes staged for commit
git-is-stashed Test if there are changes in the stash git-is-stashed Test if there are changes in the stash
git-is-touched Test if there are changes in the working tree git-is-touched Test if there are changes in the working tree
... ...
``` ```
The legend consists of: The legend consists of:
* `*` The plugin is enabled * `*` The plugin is installed
* `>` The plugin is a prompt * `>` The plugin is a prompt
* `@` The plugin is a symbolic link * `@` The plugin is a symbolic link

View file

@ -1,31 +0,0 @@
set -l path $DIRNAME/.t-$TESTNAME-(random)
function -S setup
mkdir -p $path $path/void
printf "%s\n" foo bar > $path/bundle
printf "%s\n" baz norf > $path/fishfile
function fisher_install
set -l count 0
while read -l plugin
set count (math $count + 1)
end
echo "$count plugin/s installed."
end
end
function -S teardown
rm -rf $path
functions -e fisher_install
end
test "$TESTNAME - Install dependencies from one or more bundle/fishfile files"
(__fisher_deps_install $path ^ /dev/null) = 4
end
test "$TESTNAME - Print 0 to indicate no dependencies were installed"
(__fisher_deps_install $path/void) = 0
end

View file

@ -1,31 +0,0 @@
set -l path $DIRNAME/.t-$TESTNAME-(random)
function -S setup
mkdir -p $path
function foobar
echo foobar
end
end
function -S teardown
rm -rf $path
functions -e foobar
end
test "$TESTNAME - Return the path where the plugin was created"
$path/foobar = (
pushd $path
__fisher_function_to_plugin foobar
popd
)
end
test "$TESTNAME - Create a file with the contents of the given function"
(functions foobar | xargs) = (
pushd $path
set -l plugin_path (__fisher_function_to_plugin foobar)
cat $plugin_path/foobar.fish | xargs
popd
)
end

View file

@ -1,5 +1,3 @@
# Reset Fisherman's configuration state.
if functions -q debug if functions -q debug
functions -c debug debug_copy functions -c debug debug_copy
end end
@ -20,10 +18,6 @@ set -g fisher_index file://$plugins/index
__fisher_index_update __fisher_index_update
function -S __fisher_url_clone -a url path
cp -rf (echo $url | sed "s|https://github.com/|$plugins/|") $path
end
function spin function spin
eval $argv eval $argv
end end

View file

@ -5,9 +5,9 @@ function -S setup
source $DIRNAME/helpers/config-mock.fish $path/config source $DIRNAME/helpers/config-mock.fish $path/config
fisher install foo bar --quiet --no-color fisher install $DIRNAME/fixtures/plugins/{foo,bar} --quiet
fisher install https://github.com/foobar --quiet --no-color fisher install $DIRNAME/fixtures/plugins/foobar --quiet
fisher install $DIRNAME/fixtures/plugins/baz --quiet --no-color fisher install $DIRNAME/fixtures/plugins/baz --quiet
end end
function -S teardown function -S teardown

View file

@ -9,12 +9,6 @@ function -S setup
printf "%s\n" foo bar baz theme > $path/fishfile printf "%s\n" foo bar baz theme > $path/fishfile
set -g fisher_cache $path/cache set -g fisher_cache $path/cache
# Fisherman uses the Fishfile to keep track of what plugins are currently installed
# so we need to create one in order to test all of fisher list=<styles>.
# See also `list-fishfile.fish`.
set -g fisher_file $path/fishfile set -g fisher_file $path/fishfile
set -U fisher_prompt theme set -U fisher_prompt theme
@ -26,23 +20,18 @@ function -S teardown
functions -e git functions -e git
end end
test "$TESTNAME - Append > to active theme" test "$TESTNAME - Append @ to linked theme"
(fisher list | sed -n '/>.*/p') = "> theme" (fisher list | sed -n '/@.*/p') = "@ theme"
end end
test "$TESTNAME - Append * to active plugins" test "$TESTNAME - Indent plugins to match indent when links or prompts are installed"
(fisher list | sed -n '/\*.*/p' | xargs) = "* bar * baz * foo" (fisher list | sed -n '/ .*/p' | xargs) = "foo bar baz"
end end
test "$TESTNAME - Add one space indentation to disabled plugins to align with > and *" test "$TESTNAME - Do not display disabled plugins"
(fisher list | sed '/^[\*>].*/d') = " norf" -z (
end rm $path/fishfile
fisher list
test "$TESTNAME - Do not add indentation when no plugins are enabled"
(rm $path/fishfile; fisher list) = (
for plugin in foo bar baz norf theme
echo $plugin
end
) )
end end

View file

@ -5,7 +5,7 @@ function -S setup
source $DIRNAME/helpers/config-mock.fish $path/config source $DIRNAME/helpers/config-mock.fish $path/config
fisher install foo bar foobar --quiet --no-color fisher install $DIRNAME/fixtures/plugins/{foo,bar,foobar} --quiet
fisher uninstall foo --quiet fisher uninstall foo --quiet
fisher uninstall foobar --quiet --force fisher uninstall foobar --quiet --force
end end