mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 10:02:27 +08:00

Replace package database with independently installed package repositories - Add support for fetching and installing from package repositories containing package URLs and metadata - Support multiple package repository sources - Add new repo command - Remove submit command - Enhance describe and search commands - Fix and improve help text for new and adjusted commands - Fix bundle install exit status - Refer to plugins as "plugins" instead of the general term "packages" - Code clarity improvements - Put plugin/theme distinction into package metadata
32 lines
751 B
Fish
32 lines
751 B
Fish
function omf.bundle.install
|
|
test -n "$argv";
|
|
and set bundle $argv
|
|
or set bundle $OMF_CONFIG/bundle
|
|
|
|
if test -f $bundle
|
|
set packages (omf.packages.list)
|
|
set bundle_contents (cat $bundle | sort -u)
|
|
|
|
for record in $bundle_contents
|
|
test -n "$record"; or continue
|
|
|
|
set type (echo $record | cut -s -d' ' -f1 | sed 's/ //g')
|
|
contains $type theme package; or continue
|
|
|
|
set name_or_url (echo $record | cut -s -d' ' -f2- | sed 's/ //g')
|
|
test -n "$name_or_url"; or continue
|
|
|
|
set name (omf.packages.name $name_or_url)
|
|
|
|
if not contains $name $packages
|
|
omf.packages.install $name_or_url;
|
|
or set error
|
|
end
|
|
end
|
|
|
|
sort -u $bundle -o $bundle
|
|
end
|
|
|
|
not set -q error
|
|
end
|