From 2785f2d5259279ae09a1fbb2be311e590b235fc5 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Thu, 13 Jul 2017 16:45:06 -0400 Subject: [PATCH] Fix #529 --- pkg/omf/functions/cli/omf.cli.theme.fish | 6 +++++- pkg/omf/functions/packages/omf.packages.new.fish | 4 ---- pkg/omf/functions/themes/omf.theme.set.fish | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/omf/functions/cli/omf.cli.theme.fish b/pkg/omf/functions/cli/omf.cli.theme.fish index 1f3841e..4d26773 100644 --- a/pkg/omf/functions/cli/omf.cli.theme.fish +++ b/pkg/omf/functions/cli/omf.cli.theme.fish @@ -14,7 +14,11 @@ function omf.cli.theme -a name echo (omf::under)"Available:"(omf::off) omf.index.query --type=theme | column 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 '*' echo (omf::err)"Invalid number of arguments"(omf::off) >&2 echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" []" >&2 diff --git a/pkg/omf/functions/packages/omf.packages.new.fish b/pkg/omf/functions/packages/omf.packages.new.fish index 849701f..936416a 100644 --- a/pkg/omf/functions/packages/omf.packages.new.fish +++ b/pkg/omf/functions/packages/omf.packages.new.fish @@ -67,10 +67,6 @@ function omf.packages.new -a option name $github $user $name echo (omf::em)"Switched to $dir"(omf::off) - - if test "$option" = themes - omf.theme.set $name - end else echo (omf::err)"\$OMF_CONFIG and/or \$OMF_PATH undefined."(omf::off) >&2 exit $OMF_UNKNOWN_ERR diff --git a/pkg/omf/functions/themes/omf.theme.set.fish b/pkg/omf/functions/themes/omf.theme.set.fish index f5e69cc..5fd7409 100644 --- a/pkg/omf/functions/themes/omf.theme.set.fish +++ b/pkg/omf/functions/themes/omf.theme.set.fish @@ -1,7 +1,5 @@ function omf.theme.set -a target_theme - if not contains "$target_theme" (omf.packages.list --theme) - echo (omf::err)"Theme not installed!"(omf::off) - echo Install it using (omf::em)omf install $target_theme(omf::off) + if not test -d $OMF_PATH/themes/$target_theme return $OMF_INVALID_ARG end