Commit f967a0d3 authored by Bruno's avatar Bruno

Merge pull request #125 from derekstavis/fix-bundle-install

Rewrite bundle install to conform with latest `omf.install` interface
parents d16796b6 d224e015
......@@ -2,30 +2,28 @@ function omf.bundle.install
set bundle $OMF_CONFIG/bundle
if test -f $bundle
set packages (omf.packages.list --installed --plugin)
set themes (omf.packages.list --installed --theme)
set packages (omf.packages.list --installed)
set bundle_contents (cat $bundle | sort -u)
for record in $bundle_contents
set type (echo $record | cut -d' ' -f1)
set name_or_url (echo $record | cut -d' ' -f2-)
set name (basename $name_or_url | sed 's/\.git//;s/^pkg-//;s/^plugin-//;s/^theme-//')
test -n "$record"; or continue
set type (echo $record | cut -s -d' ' -f1 | sed 's/ //g')
contains $type theme package; or continue
switch $type
case "package"
if not contains $name $packages
omf.install --pkg $name_or_url
end
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-//')
case "theme"
if not contains $name $themes
omf.install --theme $name_or_url
end
if not contains $name $packages
omf.install $name_or_url;
and set installed
end
end
sort -u $bundle -o $bundle
end
return 0
set -q installed
end
......@@ -76,17 +76,18 @@ function omf -d "Oh My Fish"
case "i" "install" "get"
if test (count $argv) -eq 1
omf.bundle.install
omf.bundle.install;
and set installed
else
for package in $argv[2..-1]
if omf.install $package
set refresh
end
omf.install $package;
and set installed
end
set -q refresh; and refresh
end
set -q installed; and refresh
return 0
case "l" "ls" "list"
omf.packages.list --installed | column
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment