mirror of
https://github.com/nushell/nushell.git
synced 2025-02-22 05:21:44 +01:00
load config when requried (#5618)
This commit is contained in:
parent
98a4280c41
commit
a8db4f0b0e
38
src/main.rs
38
src/main.rs
@ -195,6 +195,25 @@ 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,
|
||||
&mut stack,
|
||||
binary_args.env_file,
|
||||
is_perf_true(),
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
let ret_val = evaluate_commands(
|
||||
commands,
|
||||
@ -217,6 +236,25 @@ 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,
|
||||
&mut stack,
|
||||
binary_args.env_file,
|
||||
is_perf_true(),
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
let ret_val = evaluate_file(
|
||||
script_name,
|
||||
|
Loading…
Reference in New Issue
Block a user