Skip to content

Commit 4741f81

Browse files
Added support for the --env-file flag on the cache subcommand
1 parent ed55e91 commit 4741f81

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cli/args/flags.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,7 @@ Future runs of this module will trigger no downloads or compilation unless --rel
18971897
.arg(frozen_lockfile_arg())
18981898
.arg(allow_scripts_arg())
18991899
.arg(allow_import_arg())
1900+
.arg(env_file_arg())
19001901
})
19011902
}
19021903

@@ -4659,6 +4660,7 @@ fn cache_parse(
46594660
frozen_lockfile_arg_parse(flags, matches);
46604661
allow_scripts_arg_parse(flags, matches)?;
46614662
allow_import_parse(flags, matches)?;
4663+
env_file_arg_parse(flags, matches);
46624664
let files = matches.remove_many::<String>("file").unwrap().collect();
46634665
flags.subcommand = DenoSubcommand::Cache(CacheFlags { files });
46644666
Ok(())
@@ -7584,6 +7586,18 @@ mod tests {
75847586
..Flags::default()
75857587
}
75867588
);
7589+
7590+
let r = flags_from_vec(svec!["deno", "cache", "--env-file", "script.ts"]);
7591+
assert_eq!(
7592+
r.unwrap(),
7593+
Flags {
7594+
subcommand: DenoSubcommand::Cache(CacheFlags {
7595+
files: svec!["script.ts"],
7596+
}),
7597+
env_file: Some(vec![".env".to_string()]),
7598+
..Flags::default()
7599+
}
7600+
);
75877601
}
75887602

75897603
#[test]

0 commit comments

Comments
 (0)