mirror of
https://github.com/nushell/nushell
synced 2024-12-27 13:33:16 +00:00
load config when requried (#5618)
This commit is contained in:
parent
98a4280c41
commit
a8db4f0b0e
1 changed files with 38 additions and 0 deletions
38
src/main.rs
38
src/main.rs
|
@ -195,6 +195,25 @@ 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.
|
||||||
|
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,
|
||||||
|
&mut stack,
|
||||||
|
binary_args.env_file,
|
||||||
|
is_perf_true(),
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let ret_val = evaluate_commands(
|
let ret_val = evaluate_commands(
|
||||||
commands,
|
commands,
|
||||||
|
@ -217,6 +236,25 @@ 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.
|
||||||
|
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,
|
||||||
|
&mut stack,
|
||||||
|
binary_args.env_file,
|
||||||
|
is_perf_true(),
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let ret_val = evaluate_file(
|
let ret_val = evaluate_file(
|
||||||
script_name,
|
script_name,
|
||||||
|
|
Loading…
Reference in a new issue