mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
Fix load order of config files (#6006)
This commit is contained in:
parent
b7d3623e53
commit
920e0acb85
1 changed files with 22 additions and 18 deletions
40
src/main.rs
40
src/main.rs
|
@ -205,16 +205,8 @@ fn main() -> Result<()> {
|
|||
NUSHELL_FOLDER,
|
||||
is_perf_true(),
|
||||
);
|
||||
|
||||
// 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() {
|
||||
config_files::read_config_file(
|
||||
&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(
|
||||
commands,
|
||||
&init_cwd,
|
||||
|
@ -250,16 +252,8 @@ fn main() -> Result<()> {
|
|||
NUSHELL_FOLDER,
|
||||
is_perf_true(),
|
||||
);
|
||||
|
||||
// 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() {
|
||||
config_files::read_config_file(
|
||||
&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(
|
||||
script_name,
|
||||
&args_to_script,
|
||||
|
|
Loading…
Reference in a new issue