From ec611526ac72e2b692abe7acebafe0e9ad752b23 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Mon, 25 Apr 2022 08:40:55 +1200 Subject: [PATCH] Warn if we see let config = ../.. (#5318) --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index e7bd915a3..8eb18699e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -277,6 +277,14 @@ fn setup_config( config_files::read_config_file(engine_state, stack, env_file, is_perf_true(), true); config_files::read_config_file(engine_state, stack, config_file, is_perf_true(), false); + + // Give a warning if we see `$config` for a few releases + { + let working_set = StateWorkingSet::new(engine_state); + if working_set.find_variable(b"$config").is_some() { + println!("warning: use `let-env config = ...` instead of `let config = ...`"); + } + } } fn parse_commandline_args(