2015-09-08 06:34:11 +08:00
|
|
|
function omf.bundle.install
|
2015-09-12 01:53:27 +08:00
|
|
|
set bundle $OMF_CONFIG/bundle
|
2015-08-30 06:22:53 +08:00
|
|
|
|
2015-09-12 01:53:27 +08:00
|
|
|
if test -f $bundle
|
2015-10-15 11:23:22 +08:00
|
|
|
set packages (omf.packages.list --installed)
|
2015-09-12 01:53:27 +08:00
|
|
|
set bundle_contents (cat $bundle | sort -u)
|
2015-08-30 06:22:53 +08:00
|
|
|
|
2015-09-12 01:53:27 +08:00
|
|
|
for record in $bundle_contents
|
2015-10-15 11:23:22 +08:00
|
|
|
test -n "$record"; or continue
|
|
|
|
|
|
|
|
set type (echo $record | cut -s -d' ' -f1 | sed 's/ //g')
|
|
|
|
contains $type theme package; or continue
|
2015-08-30 06:22:53 +08:00
|
|
|
|
2015-10-15 11:23:22 +08:00
|
|
|
set name_or_url (echo $record | cut -s -d' ' -f2- | sed 's/ //g')
|
|
|
|
test -n "$name_or_url"; or continue
|
|
|
|
|
|
|
|
set name (basename $name_or_url | sed 's/\.git//;s/^pkg-//;s/^plugin-//;s/^theme-//')
|
2015-08-30 06:22:53 +08:00
|
|
|
|
2015-10-15 11:23:22 +08:00
|
|
|
if not contains $name $packages
|
|
|
|
omf.install $name_or_url;
|
|
|
|
and set installed
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|
|
|
|
end
|
2015-09-12 01:54:00 +08:00
|
|
|
|
|
|
|
sort -u $bundle -o $bundle
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|
|
|
|
|
2015-10-15 11:23:22 +08:00
|
|
|
set -q installed
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|