mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
16 lines
407 B
Fish
16 lines
407 B
Fish
function __fisher_file_remove -a plugin file
|
|
if __fisher_file_contains $plugin < $file
|
|
set pattern (printf "%s\n" $plugin | __fisher_string_escape)
|
|
|
|
if test ! -z "$pattern"
|
|
set pattern "/^$pattern\$/d"
|
|
end
|
|
|
|
debug "Remove '%s' from fishfile '%s'" "$plugin" "$file"
|
|
|
|
sed -E "$pattern" < $file > $file.tmp
|
|
|
|
command mv $file.tmp $file
|
|
end
|
|
end
|