fisher/functions/__fisher_plugin_walk.fish
Jorge Bucaran ebec1eaa01
Fisherman 1.0 RC
* Deprecate fisher --list in favor of a new command fisher list.
  The behavior is roughly the same. See fisher help list for
  usage. tl;dr: Use list to query the local system / cache and
  search to query the index.

* Teach fisher_plugin_walk about fish_postexec,
  fish_command_not_found and fish_preexec event emitters and
  erase them during uninstall if they were defined in a snippet.

* Fisherman now recognizes the following aliases by default:
  i for install, u for update, l for list, s for search and h
  for help.

* Large documentation rewrite. Better, simpler, more concise
  and more consistent.

* Fisherman now detects if users have modified their fish
  prompt using fish_config and if so, uninstalls $fisher_prompt.
2016-02-29 23:13:29 +09:00

57 lines
1.6 KiB
Fish

function __fisher_plugin_walk -a plugin path
debug "Walk %s" "$path"
for file in $path/{*,{conf.d,modules}/*,functions/**}.{fish,load} $path/completions/*.fish
set -l name (basename $file .fish)
set -l base $name.fish
debug "File %s" $file
switch $file
case \*/{fish_user_,}key_bindings.fish
printf "%s %s %s\n" --bind $file
case \*/uninstall.fish
printf "%s %s\n" --uninstall $file
case \*/completions/\*.fish
printf "%s %s %s\n" --source $file completions/$base
case \*/{conf.d,modules}/\?\* \*/\*config.fish \*/{before.,}init.fish \*/$plugin.load
switch "$base"
case \*$plugin\*
case \*
debug "Move %s to %s" $plugin $plugin.$base
set base $plugin.$base
end
switch "$name"
case fish_postexec fish_preexec fish_command_not_found
case \*
set name
end
printf "%s %s %s %s\n" --source $file conf.d/$base $name
case \*
printf "%s %s %s %s\n" --source $file functions/$base $name
end
end
for file in $path/{functions/,}*.{py,rb,php,pl,awk,sed}
set -l base (basename $file)
debug "Script %s" $file
printf "%s %s %s\n" -- $file functions/$base
end
for n in (seq 9)
for file in $path/man/man$n/*.$n
debug "Man %s" $file
printf "%s %s %s\n" --man $file man/man$n/(basename $file)
end
end
end