clean broken soft link when fisher install

This commit is contained in:
detailyang 2016-04-10 01:31:02 +08:00
parent 29218a069c
commit 8b5ffdcf93

View file

@ -70,7 +70,15 @@ function -S __fisher_plugin_fetch
printf "%s\n" "$name"
debug "plugin %s" "$name"
if test ! -e $path -a ! -L $path
if test ! -e $path
if test -L $path
set -l realpath (command readlink $path)
if __fisher_file_remove "$realpath" "$fisher_file"
debug "fishfile remove broken link %s ok" "$realpath"
else
debug "fishfile remove broken link %s fail" "$realpath"
end
end
if not set -q __fisher_fetch_status
set -g __fisher_fetch_status
printf "Installing plugin/s\n" > $stderr