Merge pull request #530 from oh-my-fish/fix/529-omf-new-theme

Fix #529
This commit is contained in:
Stephen M. Coakley 2017-10-05 11:31:03 -05:00 committed by GitHub
commit 31f1c3540b
3 changed files with 6 additions and 8 deletions

View File

@ -14,7 +14,11 @@ function omf.cli.theme -a name
echo (omf::under)"Available:"(omf::off) echo (omf::under)"Available:"(omf::off)
omf.index.query --type=theme | column omf.index.query --type=theme | column
case 1 case 1
omf.theme.set $name if not omf.theme.set $name
echo (omf::err)"Theme not installed!"(omf::off)
echo Install it using (omf::em)omf install $name(omf::off)
return $OMF_INVALID_ARG
end
case '*' case '*'
echo (omf::err)"Invalid number of arguments"(omf::off) >&2 echo (omf::err)"Invalid number of arguments"(omf::off) >&2
echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" [<theme name>]" >&2 echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" [<theme name>]" >&2

View File

@ -67,10 +67,6 @@ function omf.packages.new -a option name
$github $user $name $github $user $name
echo (omf::em)"Switched to $dir"(omf::off) echo (omf::em)"Switched to $dir"(omf::off)
if test "$option" = themes
omf.theme.set $name
end
else else
echo (omf::err)"\$OMF_CONFIG and/or \$OMF_PATH undefined."(omf::off) >&2 echo (omf::err)"\$OMF_CONFIG and/or \$OMF_PATH undefined."(omf::off) >&2
exit $OMF_UNKNOWN_ERR exit $OMF_UNKNOWN_ERR

View File

@ -1,7 +1,5 @@
function omf.theme.set -a target_theme function omf.theme.set -a target_theme
if not contains "$target_theme" (omf.packages.list --theme) if not test -d $OMF_PATH/themes/$target_theme
echo (omf::err)"Theme not installed!"(omf::off)
echo Install it using (omf::em)omf install $target_theme(omf::off)
return $OMF_INVALID_ARG return $OMF_INVALID_ARG
end end