Commit ccd704bc authored by Derek Stavis's avatar Derek Stavis Committed by Pablo Santiago Blum de Aguiar

omf.theme: Validate if theme is installed

parent 7ccdada8
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment