From 3a3daa06c2e6faba4ebd77d3d374587ee7993f40 Mon Sep 17 00:00:00 2001 From: Don Date: Tue, 25 Aug 2015 14:17:07 -0400 Subject: [PATCH] Only show deprecation warnings when omf is loaded. The oh-my-fish.fish startup file is sourced when changing themes after the `fish_theme` variable is set. The deprecation warning should only be shown if the user sets the deprecated variables. --- oh-my-fish.fish | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/oh-my-fish.fish b/oh-my-fish.fish index 3cece54..8b4a9e4 100644 --- a/oh-my-fish.fish +++ b/oh-my-fish.fish @@ -9,16 +9,26 @@ if not contains $fish_path/functions/ $fish_function_path set fish_function_path $fish_path/functions/ $fish_function_path end -if set -q fish_plugins - set_color red - echo '$fish_plugins usage has been deprecated. Please see https://asciinema.org/a/20802.' - set_color normal -end +if not set -q __omf_loaded + if set -q fish_plugins + set_color red + echo '$fish_plugins usage has been deprecated; please use the \'Plugin\' command.' + set_color normal + end + + if set -q fish_theme + set_color red + echo '$fish_theme usage has been deprecated; please use the \'Theme\' command.' + set_color normal + end + + if set -q fish_plugins; or set -q fish_theme + set_color yellow + echo 'See https://asciinema.org/a/20802 for info on updating config.fish.' + set_color normal + end -if set -q fish_theme - set_color red - echo '$fish_theme usage has been deprecated. Please see https://asciinema.org/a/20802.' - set_color normal + set -g __omf_loaded "true" end # Add imported plugins, completions and themes. Customize imported