2015-09-07 19:34:11 -03:00
|
|
|
function omf.bundle.install
|
2015-09-11 14:53:27 -03:00
|
|
|
set bundle $OMF_CONFIG/bundle
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-09-11 14:53:27 -03:00
|
|
|
if test -f $bundle
|
2015-08-29 19:22:53 -03:00
|
|
|
set packages (omf.list_local_packages)
|
|
|
|
set themes (omf.list_installed_themes)
|
2015-09-11 14:53:27 -03:00
|
|
|
set bundle_contents (cat $bundle | sort -u)
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-09-11 14:53:27 -03:00
|
|
|
for record in $bundle_contents
|
2015-08-29 19:22:53 -03:00
|
|
|
set type (echo $record | cut -d' ' -f1)
|
2015-09-07 19:34:11 -03: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-29 19:22:53 -03:00
|
|
|
|
|
|
|
switch $type
|
|
|
|
case "package"
|
2015-09-07 19:34:11 -03:00
|
|
|
if not contains $name $packages
|
2015-09-12 17:43:51 +02:00
|
|
|
omf.install --pkg $name_or_url
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|
|
|
|
|
|
|
|
case "theme"
|
2015-09-07 19:34:11 -03:00
|
|
|
if not contains $name $themes
|
2015-09-12 17:43:51 +02:00
|
|
|
omf.install --theme $name_or_url
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-09-11 14:54:00 -03:00
|
|
|
|
|
|
|
sort -u $bundle -o $bundle
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|
|
|
|
|
|
|
|
return 0
|
|
|
|
end
|