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-08-30 06:22:53 +08:00
|
|
|
set packages (omf.list_local_packages)
|
|
|
|
set themes (omf.list_installed_themes)
|
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-08-30 06:22:53 +08:00
|
|
|
set type (echo $record | cut -d' ' -f1)
|
2015-09-08 06:34:11 +08:00
|
|
|
set name_or_url (echo $record | cut -d' ' -f2-)
|
|
|
|
set name (basename $name_or_url | sed 's/\.git//;s/^pkg-//;s/^plugin-//;s/^theme-//')
|
2015-08-30 06:22:53 +08:00
|
|
|
|
|
|
|
switch $type
|
|
|
|
case "package"
|
2015-09-08 06:34:11 +08:00
|
|
|
if not contains $name $packages
|
2015-09-12 23:43:51 +08:00
|
|
|
omf.install --pkg $name_or_url
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
case "theme"
|
2015-09-08 06:34:11 +08:00
|
|
|
if not contains $name $themes
|
2015-09-12 23:43:51 +08:00
|
|
|
omf.install --theme $name_or_url
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-09-12 01:54:00 +08:00
|
|
|
|
|
|
|
sort -u $bundle -o $bundle
|
2015-08-30 06:22:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return 0
|
|
|
|
end
|