mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
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:
parent
fca41816e1
commit
6c5cac3a18
43 changed files with 336 additions and 482 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,14 +1,18 @@
|
|||
# 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.
|
||||
|
||||
* 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)
|
||||
|
||||
|
@ -18,8 +22,6 @@
|
|||
fisher list - < file
|
||||
```
|
||||
|
||||
* Revise documentation.
|
||||
|
||||
## [1.3.1][v131] - 2016-03-12
|
||||
|
||||
* Fix bug in fisher_config_color_reset not declaring path variable.
|
||||
|
|
|
@ -102,8 +102,8 @@ List installed plugins.
|
|||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> shellder
|
||||
* spin
|
||||
> superman
|
||||
@ wipe
|
||||
```
|
||||
|
||||
|
@ -119,7 +119,7 @@ fisher search
|
|||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> shellder Powerline prompt optimized for speed
|
||||
> superman Powerline prompt based on Superman
|
||||
...
|
||||
```
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
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
|
||||
|
|
|
@ -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
|
|
@ -6,8 +6,6 @@ function __fisher_file_remove -a plugin file
|
|||
set pattern "/^$pattern\$/d"
|
||||
end
|
||||
|
||||
debug "File remove %s" "$plugin"
|
||||
|
||||
sed -E "$pattern" < $file > $file.tmp
|
||||
|
||||
command mv $file.tmp $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
|
|
@ -16,7 +16,7 @@ function __fisher_index_update -a timeout
|
|||
set -l index $fisher_cache/.index.tmp
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ function __fisher_key_bindings_enable -a plugin user_key_bindings
|
|||
source $user_key_bindings
|
||||
end
|
||||
|
||||
debug "Bind %s" "$user_key_bindings"
|
||||
debug "binds %s" "$user_key_bindings"
|
||||
|
||||
functions fish_user_key_bindings \
|
||||
| __fisher_key_bindings_update_user > $user_key_bindings
|
||||
|
|
|
@ -3,14 +3,14 @@ function __fisher_path_make -a path
|
|||
return
|
||||
end
|
||||
|
||||
debug "Make %s" "$path/Makefile"
|
||||
debug "make %s" "$path/Makefile"
|
||||
|
||||
pushd $path
|
||||
|
||||
set -e argv[1]
|
||||
|
||||
if not make $argv
|
||||
debug "Make fail %s" "$argv"
|
||||
debug "make fail %s" "$argv"
|
||||
popd
|
||||
return 1
|
||||
end
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
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
|
||||
return 0
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ function __fisher_plugin_disable -a plugin path option
|
|||
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
|
||||
switch "$class"
|
||||
case --bind
|
||||
debug "Unbind %s" $plugin
|
||||
debug "unbind %s" $plugin
|
||||
|
||||
__fisher_key_bindings_disable $plugin (__fisher_xdg --config
|
||||
)/fish/functions/fish_user_key_bindings.fish
|
||||
|
@ -27,12 +27,11 @@ function __fisher_plugin_disable -a plugin path option
|
|||
set -l key
|
||||
|
||||
if not set key (fisher_search --name=$plugin --name --index=$fisher_cache/.index)
|
||||
debug "Path $path"
|
||||
set key (__fisher_url_from_path $path)
|
||||
end
|
||||
|
||||
debug "fishfile remove %s start" "$key"
|
||||
|
||||
|
||||
if set key (__fisher_file_remove "$key" "$fisher_file")
|
||||
debug "fishfile remove %s ok" "$key"
|
||||
else
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
function __fisher_plugin_enable -a plugin path
|
||||
debug "Enable %s" "$plugin"
|
||||
debug "enable %s" "$plugin"
|
||||
|
||||
if __fisher_path_is_prompt $path
|
||||
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"
|
||||
end
|
||||
|
||||
set -U fisher_prompt $plugin
|
||||
end
|
||||
|
||||
set -l link -f
|
||||
|
||||
if test -L $path
|
||||
set link -sfF
|
||||
end
|
||||
set -l link -sfF
|
||||
|
||||
__fisher_plugin_walk "$plugin" "$path" | while read -l class source target name
|
||||
switch "$class"
|
||||
case --bind
|
||||
debug "Bind %s" $source
|
||||
debug "bind %s" $source
|
||||
|
||||
__fisher_key_bindings_enable $plugin (__fisher_xdg --config
|
||||
)/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
|
||||
|
||||
if test "$class" = --source
|
||||
debug "Source %s" "$fisher_config/$target"
|
||||
debug "source %s" "$fisher_config/$target"
|
||||
__fisher_plugin_source $plugin $fisher_config/$target
|
||||
|
||||
if test "$name" = set_color_custom
|
||||
debug "Colors"
|
||||
debug "color save"
|
||||
__fisher_config_color_save "$fisher_config/fish_colors"
|
||||
set_color_custom
|
||||
end
|
||||
|
@ -53,12 +49,12 @@ function __fisher_plugin_enable -a plugin path
|
|||
|
||||
if test -s $fisher_file
|
||||
if __fisher_file_contains "$item" --quiet $fisher_file
|
||||
debug "File skip %s" "$item"
|
||||
debug "file skip %s" "$item"
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
debug "File add %s" "$item"
|
||||
debug "file add %s" "$item"
|
||||
|
||||
printf "%s\n" $item >> $fisher_file
|
||||
end
|
||||
|
|
127
functions/__fisher_plugin_fetch.fish
Normal file
127
functions/__fisher_plugin_fetch.fish
Normal 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
|
|
@ -1,4 +1,4 @@
|
|||
function __fisher_plugin_link -a options source target
|
||||
debug "Link %s" $target
|
||||
debug "link %s" $target
|
||||
command ln $options $source $target
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function __fisher_plugin_unlink -a file name
|
||||
debug "Unlink %s" $file
|
||||
debug "unlink %s" $file
|
||||
command rm -f $file
|
||||
|
||||
if test ! -z "$name"
|
||||
debug "Erase %s" $name
|
||||
debug "erase %s" $name
|
||||
functions -e $name
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
function __fisher_plugin_validate -a plugin
|
||||
if test -z "$plugin"
|
||||
return 1
|
||||
end
|
||||
|
||||
if set -q argv[2]
|
||||
printf "%s\n" "$argv"
|
||||
return 1
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
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
|
||||
set -l name (basename $file .fish)
|
||||
set -l base $name.fish
|
||||
|
||||
debug "File %s" $file
|
||||
debug "file %s" $file
|
||||
|
||||
switch $file
|
||||
case \*/{fish_user_,}key_bindings.fish
|
||||
|
@ -41,14 +41,14 @@ function __fisher_plugin_walk -a plugin path
|
|||
set -l prefix functions
|
||||
set -l target $prefix/(basename $file)
|
||||
|
||||
debug "Script %s" $target
|
||||
debug "script %s" $target
|
||||
|
||||
printf "%s %s %s\n" -- $file $target
|
||||
end
|
||||
|
||||
for n in (seq 9)
|
||||
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)
|
||||
end
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
function __fisher_prompt_reset
|
||||
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
|
||||
|
||||
for prompt in $argv/functions/fish_prompt.fish
|
||||
if test -s $prompt
|
||||
debug "Reset prompt %s" $prompt
|
||||
debug "reset prompt %s" $prompt
|
||||
|
||||
source $prompt
|
||||
return
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
||||
if test "$sum_before" != "$sum_after"
|
||||
debug "Uninstall %s" "$fisher_prompt"
|
||||
debug "uninstall %s" "$fisher_prompt"
|
||||
fisher_uninstall "$fisher_prompt" -q
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function fisher -d "Fish plugin manager"
|
||||
function fisher -d "fish plugin manager"
|
||||
set -l value
|
||||
set -l option help
|
||||
|
||||
|
@ -17,7 +17,7 @@ function fisher -d "Fish plugin manager"
|
|||
set option version
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ function fisher -d "Fish plugin manager"
|
|||
switch "$option"
|
||||
case command
|
||||
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
|
||||
if test "$value" = "$alias"
|
||||
|
@ -62,19 +62,8 @@ function fisher -d "Fish plugin manager"
|
|||
printf "Commands:\n"
|
||||
|
||||
__fisher_help_commands | sed "
|
||||
|
||||
s/^/ /
|
||||
s/;/"\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"
|
||||
" | column -ts\t
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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]
|
||||
man fisher
|
||||
return
|
||||
|
@ -22,7 +22,7 @@ function fisher_help -d "Show command help"
|
|||
return
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
|
|
|
@ -1,168 +1,54 @@
|
|||
function fisher_install -d "Install plugins"
|
||||
set -l plugins
|
||||
function fisher_install -d "Install plugins (i)"
|
||||
set -l items
|
||||
set -l option
|
||||
set -l stdout /dev/stdout
|
||||
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
|
||||
switch "$1"
|
||||
case _
|
||||
set plugins $plugins $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
|
||||
set items $items $2
|
||||
|
||||
case q quiet
|
||||
set stdout /dev/null
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "Usage: fisher install [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
printf " -f --force Reinstall given plugin/s\n"
|
||||
printf "Usage: fisher install [<plugins>] [--quiet] [--help]\n\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -C --no-color Turn off color display\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
set -l link
|
||||
command mkdir -p $fisher_cache $fisher_config/{functions,completions,conf.d,man}
|
||||
|
||||
set -l time (date +%s)
|
||||
set -l count 0
|
||||
set -l index 1
|
||||
set -l total (count $plugins)
|
||||
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]
|
||||
printf "%s\n" $plugins
|
||||
else
|
||||
__fisher_file
|
||||
set -l plugins (__fisher_plugin_fetch $items | awk '!seen[$0]++')
|
||||
|
||||
end | while read -l item
|
||||
debug "Validate %s" $item
|
||||
for plugin in $plugins
|
||||
set -l path $fisher_cache/$plugin
|
||||
|
||||
if not set item (__fisher_plugin_validate $item)
|
||||
debug "Validate fail %s" $item
|
||||
printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr
|
||||
continue
|
||||
if test -d $path
|
||||
__fisher_path_make "$path" --quiet
|
||||
__fisher_plugin_enable "$plugin" "$path"
|
||||
|
||||
set count (math $count + 1)
|
||||
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
|
||||
|
||||
set time (math (date +%s) - $time)
|
||||
|
@ -173,16 +59,14 @@ function fisher_install -d "Install plugins"
|
|||
end
|
||||
|
||||
if test "$count" -le 0
|
||||
printf "No plugins were installed.\n" > $stdout
|
||||
printf "No plugins were installed\n" > $stdout
|
||||
return 1
|
||||
end
|
||||
|
||||
debug "Reset completions and key bindings start"
|
||||
|
||||
__fisher_complete_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
|
||||
|
|
|
@ -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
|
||||
|
||||
if test -f "$fisher_file"
|
||||
|
@ -7,37 +7,31 @@ function fisher_list -a key -d "List installed plugins"
|
|||
|
||||
switch "$key"
|
||||
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"
|
||||
return 1
|
||||
if test ! -z "$fisher_prompt"
|
||||
set indent " "
|
||||
end
|
||||
|
||||
set -l indent " "
|
||||
|
||||
if test -z "$enabled"
|
||||
set indent ""
|
||||
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
|
||||
for plugin in $links
|
||||
if contains -- "$plugin" $enabled
|
||||
set indent " "
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
case -l --link
|
||||
find $fisher_cache/* -maxdepth 0 -type l ^ /dev/null | sed 's|.*/||'
|
||||
for plugin in $enabled
|
||||
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
|
||||
if test ! -z "$enabled"
|
||||
|
@ -55,8 +49,7 @@ function fisher_list -a key -d "List installed plugins"
|
|||
__fisher_list
|
||||
|
||||
case -h
|
||||
printf "Usage: fisher list [--enabled] [--disabled] [--link]\n\n"
|
||||
printf " -l --link List plugins that are symbolic links\n"
|
||||
printf "Usage: fisher list [--enabled] [--disabled] [--help]\n\n"
|
||||
printf " --enabled List plugins that are enabled\n"
|
||||
printf " --disabled List plugins that are disabled\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function fisher_search -d "Search plugin index"
|
||||
function fisher_search -d "Search plugin index (s)"
|
||||
set -l fields
|
||||
set -l query
|
||||
set -l index
|
||||
|
@ -6,7 +6,7 @@ function fisher_search -d "Search plugin index"
|
|||
set -l format
|
||||
set -l option
|
||||
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)
|
||||
|
||||
getopts $argv | while read -l 1 2 3
|
||||
|
@ -87,7 +87,7 @@ function fisher_search -d "Search plugin index"
|
|||
return
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
|
@ -105,7 +105,7 @@ function fisher_search -d "Search plugin index"
|
|||
if test $fisher_last_update -gt $fisher_update_interval -o ! -f $index
|
||||
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"
|
||||
__fisher_complete_reset
|
||||
else
|
||||
|
@ -132,9 +132,9 @@ function fisher_search -d "Search plugin index"
|
|||
end
|
||||
end
|
||||
|
||||
set -l color_name (set_color $fish_color_command -o)
|
||||
set -l color_url (set_color $fish_color_quote -u)
|
||||
set -l color_tag (set_color $fish_color_quote)
|
||||
set -l color_name (set_color $fish_color_quote)
|
||||
set -l color_url (set_color $fish_color_end -u)
|
||||
set -l color_tag (set_color $fish_color_command)
|
||||
set -l color_weak (set_color white -o)
|
||||
set -l color_author (set_color -u)
|
||||
set -l color_normal (set_color $fish_color_normal)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function fisher_uninstall -d "Uninstall plugins"
|
||||
function fisher_uninstall -d "Uninstall plugins (r)"
|
||||
set -l plugins
|
||||
set -l option
|
||||
set -l stdout /dev/stdout
|
||||
|
@ -28,74 +28,63 @@ function fisher_uninstall -d "Uninstall plugins"
|
|||
return
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
set -l time (date +%s)
|
||||
set -l count 0
|
||||
set -l index 1
|
||||
set -l total (count $plugins)
|
||||
set -l skipped
|
||||
set -l indicator "▸"
|
||||
set -l time (date +%s)
|
||||
|
||||
set -l IFS \t
|
||||
|
||||
printf "Uninstalling\n" > $stderr
|
||||
|
||||
if set -q plugins[1]
|
||||
printf "%s\n" $plugins
|
||||
else
|
||||
__fisher_file
|
||||
|
||||
end | while read -l item path
|
||||
debug "Validate %s" $item
|
||||
debug "validate %s" $item
|
||||
|
||||
if not set item (__fisher_plugin_validate $item)
|
||||
debug "Validate fail %s" $item
|
||||
printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr
|
||||
debug "validate fail %s" $item
|
||||
printf "fisher: '%s' is not a valid plugin\n" $item > $stderr
|
||||
continue
|
||||
end
|
||||
|
||||
debug "Validate ok %s" $item
|
||||
debug "validate ok %s" $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
|
||||
end
|
||||
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
debug "Uninstall %s" "$name"
|
||||
|
||||
if not contains -- $name (fisher_list --enabled)
|
||||
if test -z "$option"
|
||||
debug "skip %s" "$name"
|
||||
|
||||
set skipped $skipped $name
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
printf "$indicator Uninstalling " > $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
|
||||
printf " %-22s\n" "$name" > $stdout
|
||||
debug "uninstall %s" "$name"
|
||||
|
||||
if __fisher_plugin_can_enable "$name" "$path"
|
||||
debug "Disable %s[:%s]" "$name" "$option"
|
||||
__fisher_plugin_disable "$name" "$path" "$option"
|
||||
else
|
||||
debug "Disable skip %s" "$name"
|
||||
debug "disable %s[:%s]" "$name" "$option"
|
||||
end
|
||||
|
||||
if test "$option" = force
|
||||
debug "Delete %s" "$path"
|
||||
command rm -rf $path
|
||||
debug "remove %s" "$path"
|
||||
end
|
||||
|
||||
set count (math $count + 1)
|
||||
|
@ -106,20 +95,18 @@ function fisher_uninstall -d "Uninstall plugins"
|
|||
if test ! -z "$skipped"
|
||||
printf "%s plugin/s skipped (%s)\n" (count $skipped) (
|
||||
printf "%s\n" $skipped | paste -sd ' ' -
|
||||
) > $stdout
|
||||
) > $stderr
|
||||
end
|
||||
|
||||
if test $count -le 0
|
||||
printf "No plugins were uninstalled.\n" > $stdout
|
||||
printf "No plugins were uninstalled\n" > $stderr
|
||||
return 1
|
||||
end
|
||||
|
||||
debug "Reset completions and key bindings start"
|
||||
|
||||
__fisher_complete_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
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
function fisher_update -d "Update plugins"
|
||||
function fisher_update -d "Update plugins (u)"
|
||||
set -l items
|
||||
set -l plugins
|
||||
set -l enabled (fisher_list --enabled)
|
||||
set -l stdout /dev/stdout
|
||||
set -l stderr /dev/stderr
|
||||
set -l indicator "▸"
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
|
@ -21,7 +21,7 @@ function fisher_update -d "Update plugins"
|
|||
return
|
||||
|
||||
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
|
||||
return 1
|
||||
end
|
||||
|
@ -39,53 +39,55 @@ function fisher_update -d "Update plugins"
|
|||
set -l time (date +%s)
|
||||
set -l previous_version (cat $fisher_home/VERSION)
|
||||
|
||||
debug "Update %s" $fisher_cache/.index
|
||||
debug "Update %s" $fisher_home
|
||||
debug "update %s" $fisher_cache/.index
|
||||
debug "update %s" $fisher_home
|
||||
|
||||
if not spin "__fisher_index_update 0" --error=$stderr
|
||||
debug "Update Index fail"
|
||||
debug "update index fail"
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
debug "Update Fisherman ok"
|
||||
debug "update fisherman ok"
|
||||
|
||||
set -l new_version (cat $fisher_home/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
|
||||
else
|
||||
printf "$indicator Aye! Fisherman is up to date\n" $time > $stderr
|
||||
printf "Aye! Fisherman is up to date\n" $time > $stderr
|
||||
end
|
||||
|
||||
set items (fisher_list --enabled)
|
||||
set items $enabled
|
||||
end
|
||||
|
||||
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)
|
||||
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
|
||||
debug "validate fail %s" $item
|
||||
continue
|
||||
end
|
||||
|
||||
set -l path (__fisher_path_from_plugin $item)
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
debug "Validate ok %s" $item
|
||||
|
||||
set plugins $plugins $path
|
||||
debug "validate ok %s" $item
|
||||
end
|
||||
|
||||
set -l time (date +%s)
|
||||
|
@ -94,21 +96,22 @@ function fisher_update -d "Update plugins"
|
|||
|
||||
if set -q plugins[1]
|
||||
if test "$total" -gt 0
|
||||
printf "$indicator Updating %d plugin/s\n" $total > $stderr
|
||||
printf "Updating %d plugin/s\n" $total > $stderr
|
||||
end
|
||||
|
||||
for path in $plugins
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
if test ! -L $path
|
||||
debug "Update start %s" "$name"
|
||||
debug "update %s" "$name"
|
||||
|
||||
fish -ic "
|
||||
spin '
|
||||
if set -l ahead (__fisher_path_update $path)
|
||||
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
|
||||
printf \" %-22s %-10s\n\" \"$name\" \"Up to date\"
|
||||
printf \" %-22s %-10s\n\" \"$name\" \"Up to date\"
|
||||
end
|
||||
|
||||
'
|
||||
|
@ -127,13 +130,13 @@ function fisher_update -d "Update plugins"
|
|||
set -l path (__fisher_path_from_plugin "$plugin")
|
||||
|
||||
if __fisher_plugin_can_enable "$plugin" "$path"
|
||||
debug "Enable %s" "$plugin"
|
||||
__fisher_plugin_enable "$plugin" "$path"
|
||||
debug "enable %s" "$plugin"
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
return
|
||||
end
|
||||
|
@ -141,13 +144,14 @@ function fisher_update -d "Update plugins"
|
|||
|
||||
set time (math (date +%s) - $time)
|
||||
|
||||
printf "%d plugin/s updated in %0.fs\n" (count $fisher_updated_plugins) $time > $stdout
|
||||
set -e fisher_updated_plugins
|
||||
if test ! -z "$fisher_updated_plugins" -a "$fisher_updated_plugins" -ne 0
|
||||
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_key_bindings_reset
|
||||
__fisher_complete_reset
|
||||
__fisher_key_bindings_reset
|
||||
|
||||
debug "Reset completions and key bindings ok"
|
||||
debug "complete and key binds reset"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -145,7 +145,7 @@ Install plugins from multiple sources\.
|
|||
.
|
||||
.nf
|
||||
|
||||
fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin
|
||||
fisher install fishtape superman ~/plugins/my_plugin
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
@ -155,4 +155,3 @@ fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin
|
|||
fisher help uninstall
|
||||
.
|
||||
.br
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ fisher-install(1) -- Install plugins
|
|||
|
||||
## SYNOPSIS
|
||||
|
||||
fisher install [*plugins* ...] [--force] [--quiet] [--help]
|
||||
fisher install [*plugins* ...] [--quiet] [--help]
|
||||
|
||||
## USAGE
|
||||
|
||||
|
@ -11,11 +11,10 @@ fisher install *url*<br>
|
|||
fisher install *name*<br>
|
||||
fisher install *path* <br>
|
||||
fisher install *owner/repo*<br>
|
||||
fisher install *function*<br>
|
||||
|
||||
## 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:
|
||||
|
||||
|
@ -39,9 +38,6 @@ If a plugin includes either a fish_prompt.fish or fish_right_prompt.fish, both f
|
|||
|
||||
## OPTIONS
|
||||
|
||||
* -f, --force:
|
||||
Reinstall given plugin/s.
|
||||
|
||||
* -q, --quiet:
|
||||
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.
|
||||
|
||||
```fish
|
||||
fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin
|
||||
fisher install fishtape superman ~/plugins/my_plugin
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBfisher\-list\fR \- List installed plugins
|
||||
|
@ -27,8 +27,8 @@ The list command displays all the plugins you have installed\.
|
|||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> shellder
|
||||
* spin
|
||||
> superman
|
||||
@ wipe
|
||||
.
|
||||
.fi
|
||||
|
@ -39,7 +39,7 @@ fisher list
|
|||
The legend consists of:
|
||||
.
|
||||
.P
|
||||
\fB*\fR Indicate the plugin is currently installed
|
||||
\fB*\fR Indicate the plugin is installed
|
||||
.
|
||||
.br
|
||||
\fB>\fR Indicate the plugin is a prompt
|
||||
|
|
|
@ -4,7 +4,7 @@ fisher-list(1) -- List installed plugins
|
|||
## SYNOPSIS
|
||||
|
||||
fisher list [*file*]<br>
|
||||
fisher list [--bare] [--link] [--enabled] [--disabled] [--help]<br>
|
||||
fisher list [--enabled] [--disabled] [--help]<br>
|
||||
|
||||
## USAGE
|
||||
|
||||
|
@ -12,39 +12,32 @@ fisher list [*file*]
|
|||
|
||||
## DESCRIPTION
|
||||
|
||||
The list command displays all the plugins you have installed.
|
||||
The list command displays all the plugins that are currently installed.
|
||||
|
||||
```
|
||||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> shellder
|
||||
* spin
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ wipe
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
`*` Indicate the plugin is currently installed<br>
|
||||
`>` Indicate the plugin is a prompt<br>
|
||||
`@` Indicate the plugin is a symbolic link<br>
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* -b, --bare:
|
||||
List plugin without decorators
|
||||
|
||||
* -l, --link:
|
||||
List plugins that are symbolic links
|
||||
|
||||
* --enabled:
|
||||
List plugins that are enabled
|
||||
List plugins that are enabled.
|
||||
|
||||
* --disabled:
|
||||
List plugins that are disabled
|
||||
List plugins that are not installed, but available in the cache.
|
||||
|
||||
* -h, --help:
|
||||
Show usage help
|
||||
Show usage help.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ fisher search
|
|||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
\.\.\.
|
||||
> shellder Powerline prompt optimized for speed
|
||||
> superman Powerline prompt based on Superman
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
|
@ -67,10 +67,10 @@ Get detailed information about a plugin\.
|
|||
.
|
||||
.nf
|
||||
|
||||
fisher search shellder
|
||||
> shellder by simnalamburt
|
||||
Powerline prompt optimized for speed
|
||||
github\.com/simnalamburt/shellder
|
||||
fisher search superman
|
||||
> superman by bucaran
|
||||
Powerline prompt based on Superman
|
||||
github\.com/fishery/superman
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
@ -224,4 +224,3 @@ fisher search \-\-name!~/^s/
|
|||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
|
||||
|
|
|
@ -30,17 +30,17 @@ fisher search
|
|||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
...
|
||||
> shellder Powerline prompt optimized for speed
|
||||
> superman Powerline prompt based on Superman
|
||||
...
|
||||
```
|
||||
|
||||
Get detailed information about a plugin.
|
||||
|
||||
```
|
||||
fisher search shellder
|
||||
> shellder by simnalamburt
|
||||
Powerline prompt optimized for speed
|
||||
github.com/simnalamburt/shellder
|
||||
fisher search superman
|
||||
> superman by bucaran
|
||||
Powerline prompt based on Superman
|
||||
github.com/fishery/superman
|
||||
```
|
||||
|
||||
Search plugins using tags.
|
||||
|
|
|
@ -15,11 +15,11 @@ fisher uninstall *owner/repo*<br>
|
|||
|
||||
## 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 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
|
||||
|
||||
|
@ -34,10 +34,10 @@ Uninstall does not remove any dependencies installed with other plugins. This be
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
* Uninstall all plugins and flush the cache.
|
||||
* Uninstall all plugins flushing the cache.
|
||||
|
||||
```fish
|
||||
fisher --list | fisher uninstall --force
|
||||
fisher list | fisher uninstall --force
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
|
|
|
@ -14,9 +14,7 @@ fisher update *owner/repo* ...<br>
|
|||
|
||||
## 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.
|
||||
|
||||
If a plugin is missing dependencies, they will be installed. If any dependencies are already installed they will not be updated.
|
||||
Update one or more plugins concurrently. If no arguments are given, update everything, including Fisherman. Use a dash `-` to read from the standard input.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
|
@ -39,9 +37,3 @@ fisher update
|
|||
```fish
|
||||
fisher list | fisher update -
|
||||
```
|
||||
|
||||
* Update all the plugins in the cache concurrently.
|
||||
|
||||
```fish
|
||||
fisher list --bare | xargs -n1 -P0 fish -c "fisher update -"
|
||||
```
|
||||
|
|
|
@ -203,7 +203,7 @@ List installed plugins\.
|
|||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> shellder
|
||||
> superman
|
||||
* spin
|
||||
@ wipe
|
||||
.
|
||||
|
@ -227,7 +227,7 @@ fisher search
|
|||
fzf Efficient keybindings for fzf
|
||||
get Press any key to continue
|
||||
\.\.\.
|
||||
> shellder Powerline prompt optimized for speed
|
||||
> superman Powerline prompt based on Superman
|
||||
\.\.\.
|
||||
.
|
||||
.fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
fisher(1) -- Fish plugin manager
|
||||
fisher(1) -- fish plugin manager
|
||||
================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
@ -9,7 +9,7 @@ fisher *command* [*options*] [--version] [--help]<br>
|
|||
|
||||
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
|
||||
|
||||
|
@ -41,7 +41,7 @@ fisher help <command>
|
|||
fisher i fishtape shark get bobthefish
|
||||
```
|
||||
|
||||
* Install Oh My Fish! plugins.
|
||||
* Install oh-my-fish plugins.
|
||||
|
||||
```fish
|
||||
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
|
||||
```
|
||||
|
||||
* Install a plugin from a Gist.
|
||||
* Install a plugin from a gist.
|
||||
|
||||
```fish
|
||||
fisher i gist.github.com/owner/1f40e1c6e0551b2666b2
|
||||
|
@ -98,10 +98,10 @@ List installed plugins.
|
|||
```
|
||||
fisher list
|
||||
debug
|
||||
* fishtape
|
||||
> shellder
|
||||
* spin
|
||||
@ wipe
|
||||
fishtape
|
||||
spin
|
||||
> superman
|
||||
@ my_aliases
|
||||
```
|
||||
|
||||
Search the index.
|
||||
|
@ -116,7 +116,7 @@ fisher search
|
|||
fzf Efficient keybindings for fzf
|
||||
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}
|
||||
...
|
||||
* fishtape TAP producing test runner
|
||||
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-empty Test if a repository is empty
|
||||
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-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
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-empty Test if a repository is empty
|
||||
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-stashed Test if there are changes in the stash
|
||||
git-is-touched Test if there are changes in the working tree
|
||||
...
|
||||
```
|
||||
|
||||
The legend consists of:
|
||||
|
||||
* `*` The plugin is enabled
|
||||
* `*` The plugin is installed
|
||||
* `>` The plugin is a prompt
|
||||
* `@` The plugin is a symbolic link
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -1,5 +1,3 @@
|
|||
# Reset Fisherman's configuration state.
|
||||
|
||||
if functions -q debug
|
||||
functions -c debug debug_copy
|
||||
end
|
||||
|
@ -20,10 +18,6 @@ set -g fisher_index file://$plugins/index
|
|||
|
||||
__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
|
||||
eval $argv
|
||||
end
|
||||
|
|
|
@ -5,9 +5,9 @@ function -S setup
|
|||
|
||||
source $DIRNAME/helpers/config-mock.fish $path/config
|
||||
|
||||
fisher install foo bar --quiet --no-color
|
||||
fisher install https://github.com/foobar --quiet --no-color
|
||||
fisher install $DIRNAME/fixtures/plugins/baz --quiet --no-color
|
||||
fisher install $DIRNAME/fixtures/plugins/{foo,bar} --quiet
|
||||
fisher install $DIRNAME/fixtures/plugins/foobar --quiet
|
||||
fisher install $DIRNAME/fixtures/plugins/baz --quiet
|
||||
end
|
||||
|
||||
function -S teardown
|
||||
|
|
|
@ -9,12 +9,6 @@ function -S setup
|
|||
printf "%s\n" foo bar baz theme > $path/fishfile
|
||||
|
||||
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 -U fisher_prompt theme
|
||||
|
||||
|
@ -26,23 +20,18 @@ function -S teardown
|
|||
functions -e git
|
||||
end
|
||||
|
||||
test "$TESTNAME - Append > to active theme"
|
||||
(fisher list | sed -n '/>.*/p') = "> theme"
|
||||
test "$TESTNAME - Append @ to linked theme"
|
||||
(fisher list | sed -n '/@.*/p') = "@ theme"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Append * to active plugins"
|
||||
(fisher list | sed -n '/\*.*/p' | xargs) = "* bar * baz * foo"
|
||||
test "$TESTNAME - Indent plugins to match indent when links or prompts are installed"
|
||||
(fisher list | sed -n '/ .*/p' | xargs) = "foo bar baz"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Add one space indentation to disabled plugins to align with > and *"
|
||||
(fisher list | sed '/^[\*>].*/d') = " norf"
|
||||
end
|
||||
|
||||
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
|
||||
test "$TESTNAME - Do not display disabled plugins"
|
||||
-z (
|
||||
rm $path/fishfile
|
||||
fisher list
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ function -S setup
|
|||
|
||||
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 foobar --quiet --force
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue