mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 06:47:09 +08:00
omf: add install_bundle function
This commit is contained in:
parent
a8dc4c29fb
commit
e8dcbb507b
27
pkg/omf/cli/omf.install_bundle.fish
Normal file
27
pkg/omf/cli/omf.install_bundle.fish
Normal file
@ -0,0 +1,27 @@
|
||||
function omf.install_bundle
|
||||
|
||||
if test -f $OMF_CONFIG/bundle
|
||||
set packages (omf.list_local_packages)
|
||||
set themes (omf.list_installed_themes)
|
||||
|
||||
for record in (cat $OMF_CONFIG/bundle)
|
||||
set type (echo $record | cut -d' ' -f1)
|
||||
set name (echo $record | cut -d' ' -f2- | sed -e 's/\.git//')
|
||||
|
||||
switch $type
|
||||
case "package"
|
||||
if not contains (basename $name) $packages
|
||||
omf.install --pkg $name
|
||||
end
|
||||
|
||||
case "theme"
|
||||
if not contains (basename $name) $themes
|
||||
omf.install --theme $name
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user