You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fisher/functions/__fisher_file_remove.fish

16 lines
383 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 "File remove %s" "$plugin"
sed -E "$pattern" < $file > $file.tmp
command mv $file.tmp $file
end
end