Fix load order of config files (#6006)

This commit is contained in:
Jakub Žádník 2022-07-10 18:12:24 +03:00 committed by GitHub
parent b7d3623e53
commit 920e0acb85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,16 +205,8 @@ fn main() -> Result<()> {
NUSHELL_FOLDER, NUSHELL_FOLDER,
is_perf_true(), is_perf_true(),
); );
// only want to load config and env if relative argument is provided. // only want to load config and env if relative argument is provided.
if binary_args.config_file.is_some() {
config_files::read_config_file(
&mut engine_state,
&mut stack,
binary_args.config_file,
is_perf_true(),
false,
);
}
if binary_args.env_file.is_some() { if binary_args.env_file.is_some() {
config_files::read_config_file( config_files::read_config_file(
&mut engine_state, &mut engine_state,
@ -225,6 +217,16 @@ fn main() -> Result<()> {
); );
} }
if binary_args.config_file.is_some() {
config_files::read_config_file(
&mut engine_state,
&mut stack,
binary_args.config_file,
is_perf_true(),
false,
);
}
let ret_val = evaluate_commands( let ret_val = evaluate_commands(
commands, commands,
&init_cwd, &init_cwd,
@ -250,16 +252,8 @@ fn main() -> Result<()> {
NUSHELL_FOLDER, NUSHELL_FOLDER,
is_perf_true(), is_perf_true(),
); );
// only want to load config and env if relative argument is provided. // only want to load config and env if relative argument is provided.
if binary_args.config_file.is_some() {
config_files::read_config_file(
&mut engine_state,
&mut stack,
binary_args.config_file,
is_perf_true(),
false,
);
}
if binary_args.env_file.is_some() { if binary_args.env_file.is_some() {
config_files::read_config_file( config_files::read_config_file(
&mut engine_state, &mut engine_state,
@ -270,6 +264,16 @@ fn main() -> Result<()> {
); );
} }
if binary_args.config_file.is_some() {
config_files::read_config_file(
&mut engine_state,
&mut stack,
binary_args.config_file,
is_perf_true(),
false,
);
}
let ret_val = evaluate_file( let ret_val = evaluate_file(
script_name, script_name,
&args_to_script, &args_to_script,