oh-my-fish/pkg/omf/cli/omf.persist.fish
Bruno Pinto 033d976dee Extract _write_bundle to omf.persist
- Add support for persisting theme information.
- Use documented private function naming scheme.
2015-09-06 22:32:13 +01:00

24 lines
490 B
Fish

function omf.persist -a type name_or_url
function __omf.write_bundle
set -l bundle $OMF_CONFIG/bundle
set -l record $argv
if test -f $bundle
if not grep $record $bundle > /dev/null 2>&1
echo $record >> $bundle
end
else
echo $record > $bundle
end
end
function __omf.write_theme
echo $argv > $OMF_CONFIG/theme
end
__omf.write_bundle "$type" "$name_or_url"
if test "$type" = theme
__omf.write_theme "$name_or_url"
end
end