mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-03-15 00:55:16 +08:00
omf.theme: Validate if theme is installed
This commit is contained in:
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…
x
Reference in New Issue
Block a user