You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
673 B
Fish
31 lines
673 B
Fish
function omf.cli.install
|
|
set fail_count 0
|
|
|
|
omf.index.update
|
|
or return 1
|
|
|
|
switch (count $argv)
|
|
case 0
|
|
omf.bundle.install;
|
|
or set fail_count 1
|
|
case '*'
|
|
for package in $argv
|
|
omf.packages.install $package;
|
|
and require $package
|
|
|
|
# If package is a theme, set it to active.
|
|
set -l themes (omf.packages.list --theme)
|
|
if contains -- $package $themes
|
|
omf.theme.set $package
|
|
else if set -l ind (contains -i -- (omf.packages.name $package) $themes)
|
|
omf.theme.set $themes[$ind]
|
|
end
|
|
|
|
test $status != 0;
|
|
and set fail_count (math $fail_count + 1)
|
|
end
|
|
end
|
|
|
|
return $fail_count
|
|
end
|