forked from extern/nushell
Fix load order of config files (#6006)
This commit is contained in:
parent
b7d3623e53
commit
920e0acb85
40
src/main.rs
40
src/main.rs
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user