omf.theme: Validate if theme is installed

pull/121/head
Derek Stavis 9 years ago committed by Pablo Santiago Blum de Aguiar
parent 7ccdada8c6
commit ccd704bca0

@ -1,4 +1,10 @@
function omf.theme -a target_theme
if not contains "$target_theme" (omf.packages.list --installed --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
end
set -l current_theme (cat $OMF_CONFIG/theme)
test "$target_theme" = "$current_theme"; and return 0
@ -10,7 +16,7 @@ function omf.theme -a target_theme
if not omf.check.fish_prompt
echo (omf::err)"Conflicting prompt setting."(omf::off)
echo "Run "(omf::em)"omf doctor"(omf::off)" and fix issues before continuing."
return 1
return $OMF_INVALID_ARG
end
# Replace autoload paths of current theme with the target one

Loading…
Cancel
Save