mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-03 14:53:41 +08:00
bc0d4847e8
In order to pro-actively diagnose an issue on someone's computer, a `omf doctor' command is being added. This command will initially check errors that could cause a theme to not be loaded, but in the future more checks are going to be added to prevent issues from being created for problems that are fixable by the Oh My Fish user alone.
25 lines
826 B
Fish
25 lines
826 B
Fish
function __omf.doctor.theme
|
|
if test -e ~/.config/fish/functions/fish_prompt.fish
|
|
echo (omf::err)"Warning: "(omf::off)(omf::em)"fish_prompt.fish"(omf::off)" is overridden."
|
|
echo (omf::em)" fish_config"(omf::off)" command persists the prompt to "(omf::em)"~/.config/fish/functions/fish_prompt.fish"(omf::off)
|
|
echo " That file takes precedence over Oh My Fish's themes. Remove the file to fix it:"
|
|
|
|
echo (omf::em)" rm ~/.config/fish/functions/fish_prompt.fish"(omf::off)
|
|
echo
|
|
|
|
return 1
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
function omf.doctor
|
|
__omf.doctor.theme; or set -l doctor_failed
|
|
|
|
if set -q doctor_failed
|
|
echo "If everything you use Oh My Fish for is working fine, please don't worry and just ignore the warnings. Thanks!"
|
|
else
|
|
echo (omf::em)"Your shell is ready to swim."(omf::off)
|
|
end
|
|
end
|