Merge pull request #110 from derekstavis/fix-bundle-add

bundle.add: fix theme being persisted twice
This commit is contained in:
Bruno 2015-10-06 21:39:12 +01:00
commit 284b318cb8

View File

@ -1,25 +1,14 @@
function omf.bundle.add -a type name_or_url
function __omf.write_bundle
set -l bundle $OMF_CONFIG/bundle
set -l record $argv
set -l bundle $OMF_CONFIG/bundle
set -l record "$type $name_or_url"
if test -f $bundle
if not grep $record $bundle > /dev/null 2>&1
echo $record >> $bundle
end
else
echo $record > $bundle
if test -f $bundle
if not grep $record $bundle > /dev/null 2>&1
echo $record >> $bundle
end
sort -u $bundle -o $bundle
else
echo $record > $bundle
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
sort -u $bundle -o $bundle
end