Allow for copy instead of linking (#401)

* Allow for optional copy on install instead of linking

* Remove eval in favor of proper test call

* Document fisher_copy variable

* Missing ?
pull/445/head
Ryan Sullivan 6 years ago committed by Jorge Bucaran
parent 4803a700a1
commit 766bd093a1

@ -152,6 +152,16 @@ set fish_function_path $fish_path/functions $fish_function_path
set fish_complete_path $fish_path/completions $fish_complete_path
```
### How do I have fisherman copy plugin files instead of linking?
By default, fisherman will create symlinks to plugin files.
To have fisherman copy files:
```fish
set -U fisher_copy true
```
### What is a fishfile and how do I use it?
The fishfile lists what you've installed, and it's automatically updated as you install / remove plugins.

@ -116,6 +116,10 @@ function $fisher_cmd_name -d "fish plugin manager"
set -g fisher_file "$fish_path/fishfile"
end
if test -z "$fisher_copy"
set -g fisher_copy false
end
switch "$argv[1]"
case --complete
__fisher_complete
@ -800,7 +804,11 @@ function __fisher_plugin_enable -a path
command mv -f "$target" "$backup_target" ^ /dev/null
end
command ln -sf "$file" "$target"
if test $fisher_copy = true
command cp -Rf "$file" "$target"
else
command ln -sf "$file" "$target"
end
builtin source "$target" ^ /dev/null
@ -815,19 +823,31 @@ function __fisher_plugin_enable -a path
for file in $path/{functions/,}*.{py,awk}
set -l base (basename "$file")
command ln -sf "$file" "$fish_path/functions/$base"
if test $fisher_copy = true
command cp -Rf "$file" "$fish_path/functions/$base"
else
command ln -sf "$file" "$fish_path/functions/$base"
end
end
for file in $path/conf.d/*.{py,awk}
set -l base (basename "$file")
command ln -sf "$file" "$fish_path/conf.d/$base"
if test $fisher_copy = true
command cp -Rf "$file" "$fish_path/conf.d/$base"
else
command ln -sf "$file" "$fish_path/conf.d/$base"
end
end
for file in $path/conf.d/*.fish
set -l base (basename "$file")
set -l target "$fish_path/conf.d/$base"
command ln -sf "$file" "$target"
if test $fisher_copy = true
command cp -Rf "$file" "$target"
else
command ln -sf "$file" "$target"
end
builtin source "$target" ^ /dev/null
end
@ -835,7 +855,11 @@ function __fisher_plugin_enable -a path
set -l base (basename "$file")
set -l target "$fish_path/completions/$base"
command ln -sf "$file" "$target"
if test $fisher_copy = true
command cp -Rf "$file" "$target"
else
command ln -sf "$file" "$target"
end
builtin source "$target" ^ /dev/null
end

Loading…
Cancel
Save