mirror of
https://github.com/jorgebucaran/fisher
synced 2024-08-17 12:31:05 +02:00
parent
8dc6f8206f
commit
4a9cecedfd
1 changed files with 43 additions and 23 deletions
66
fisher.fish
66
fisher.fish
|
@ -1,5 +1,5 @@
|
||||||
function fisher
|
function fisher
|
||||||
set -g fisher_version "2.6.10"
|
set -g fisher_version "2.6.11"
|
||||||
set -g fisher_spinners ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏
|
set -g fisher_spinners ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏
|
||||||
|
|
||||||
function __fisher_show_spinner
|
function __fisher_show_spinner
|
||||||
|
@ -154,21 +154,7 @@ function fisher
|
||||||
set -l elapsed (__fisher_get_epoch_in_ms)
|
set -l elapsed (__fisher_get_epoch_in_ms)
|
||||||
set -l items (
|
set -l items (
|
||||||
if test ! -z "$argv"
|
if test ! -z "$argv"
|
||||||
printf "%s\n" $argv | command awk '
|
printf "%s\n" $argv | __fisher_read_bundle_file
|
||||||
|
|
||||||
/^(--|-).*/ { next }
|
|
||||||
|
|
||||||
/^omf\// {
|
|
||||||
sub(/^omf\//, "oh-my-fish/")
|
|
||||||
|
|
||||||
if ($0 !~ /(theme|plugin)-/) {
|
|
||||||
sub(/^oh-my-fish\//, "oh-my-fish/plugin-")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
!dedupe[$0]++
|
|
||||||
|
|
||||||
'
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -291,9 +277,25 @@ function fisher
|
||||||
end
|
end
|
||||||
|
|
||||||
for i in $items
|
for i in $items
|
||||||
if test ! -d "$fisher_config/$i"
|
set -l name (__fisher_plugin_get_names $i)[1]
|
||||||
__fisher_log info "You can only remove plugins you've installed." $__fisher_stderr
|
|
||||||
|
if test ! -d "$fisher_config/$name"
|
||||||
set -e items
|
set -e items
|
||||||
|
|
||||||
|
if test -L "$fisher_config/$name"
|
||||||
|
set -l real_path (command readlink "$fisher_config/$name")
|
||||||
|
|
||||||
|
__fisher_log error "
|
||||||
|
I can't remove @$name@ without its real path.
|
||||||
|
" $__fisher_stderr
|
||||||
|
|
||||||
|
__fisher_log info "
|
||||||
|
Restore @$real_path@ and try again.
|
||||||
|
" $__fisher_stderr
|
||||||
|
else
|
||||||
|
__fisher_log info "You can only remove plugins you've installed." $__fisher_stderr
|
||||||
|
end
|
||||||
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -833,6 +835,12 @@ function __fisher_remove
|
||||||
for i in $argv
|
for i in $argv
|
||||||
set -l name (__fisher_plugin_get_names "$i")[1]
|
set -l name (__fisher_plugin_get_names "$i")[1]
|
||||||
|
|
||||||
|
if test ! -d "$fisher_config/$name"
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
set removed $removed $name
|
||||||
|
|
||||||
__fisher_show_spinner
|
__fisher_show_spinner
|
||||||
__fisher_plugin_decrement_ref_count "$name"
|
__fisher_plugin_decrement_ref_count "$name"
|
||||||
|
|
||||||
|
@ -850,10 +858,6 @@ function __fisher_remove
|
||||||
end < "$fisher_config/$i/fishfile"
|
end < "$fisher_config/$i/fishfile"
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -d "$fisher_config/$name"
|
|
||||||
set removed $removed $name
|
|
||||||
end
|
|
||||||
|
|
||||||
__fisher_plugin_disable "$fisher_config/$name"
|
__fisher_plugin_disable "$fisher_config/$name"
|
||||||
|
|
||||||
__fisher_show_spinner
|
__fisher_show_spinner
|
||||||
|
@ -1473,6 +1477,14 @@ function __fisher_plugin_get_missing
|
||||||
|
|
||||||
set -l name (__fisher_plugin_get_names "$i")[1]
|
set -l name (__fisher_plugin_get_names "$i")[1]
|
||||||
|
|
||||||
|
if test "$name" = fisherman
|
||||||
|
|
||||||
|
__fisher_log info "
|
||||||
|
Run @fisher update@ to update fisherman.
|
||||||
|
" > /dev/stderr
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
if set -l path (__fisher_plugin_is_installed "$name")
|
if set -l path (__fisher_plugin_is_installed "$name")
|
||||||
for file in fishfile bundle
|
for file in fishfile bundle
|
||||||
if test -s "$path/$file"
|
if test -s "$path/$file"
|
||||||
|
@ -1619,10 +1631,18 @@ end
|
||||||
|
|
||||||
function __fisher_read_bundle_file
|
function __fisher_read_bundle_file
|
||||||
command awk -v FS=\t '
|
command awk -v FS=\t '
|
||||||
/^$/ || /^[ \t]*#/ {
|
/^$/ || /^[ \t]*#/ || /^(--|-).*/ {
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/^omf\// {
|
||||||
|
sub(/^omf\//, "oh-my-fish/")
|
||||||
|
|
||||||
|
if ($0 !~ /(theme|plugin)-/) {
|
||||||
|
sub(/^oh-my-fish\//, "oh-my-fish/plugin-")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/^[ \t]*package / {
|
/^[ \t]*package / {
|
||||||
sub("^[ \t]*package ", "oh-my-fish/plugin-")
|
sub("^[ \t]*package ", "oh-my-fish/plugin-")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue