2015-09-08 06:34:11 +08:00
|
|
|
function omf.bundle.add -a type name_or_url
|
2016-04-19 16:16:58 +08:00
|
|
|
set -l bundle $OMF_CONFIG/bundle
|
|
|
|
|
2016-04-19 15:34:33 +08:00
|
|
|
if test -L $OMF_CONFIG/bundle
|
2016-04-19 15:14:10 +08:00
|
|
|
set bundle (readlink $OMF_CONFIG/bundle)
|
|
|
|
end
|
|
|
|
|
2015-10-07 04:05:16 +08:00
|
|
|
set -l record "$type $name_or_url"
|
2015-09-04 02:50:20 +08:00
|
|
|
|
2015-10-07 04:05:16 +08:00
|
|
|
if test -f $bundle
|
|
|
|
if not grep $record $bundle > /dev/null 2>&1
|
|
|
|
echo $record >> $bundle
|
2015-09-04 02:50:20 +08:00
|
|
|
end
|
2015-10-07 04:05:16 +08:00
|
|
|
else
|
|
|
|
echo $record > $bundle
|
2015-09-04 02:50:20 +08:00
|
|
|
end
|
|
|
|
|
2015-10-07 04:05:16 +08:00
|
|
|
sort -u $bundle -o $bundle
|
2015-09-04 02:50:20 +08:00
|
|
|
end
|