diff options
author | Oscar Linde <lindeoscar@gmail.com> | 2020-07-13 01:18:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 19:18:27 -0400 |
commit | 3be2064803b127c1aaa4af4aa3f060bcc8e88049 (patch) | |
tree | c6a0b739903a536fc727430f8dac38c4b578fd65 /cli/global_state.rs | |
parent | e1d814055281ee2781dfda93cf8b2637b8d65800 (diff) |
feat(cli): add DENO_CERT environment variable (#6370)
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r-- | cli/global_state.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs index e9988f4b5..3290be25f 100644 --- a/cli/global_state.rs +++ b/cli/global_state.rs @@ -58,6 +58,10 @@ impl GlobalState { let dir = deno_dir::DenoDir::new(custom_root)?; let deps_cache_location = dir.root.join("deps"); let http_cache = http_cache::HttpCache::new(&deps_cache_location); + let ca_file = flags + .ca_file + .clone() + .or_else(|| env::var("DENO_CERT").map(String::into).ok()); let file_fetcher = SourceFileFetcher::new( http_cache, @@ -65,7 +69,7 @@ impl GlobalState { flags.cache_blocklist.clone(), flags.no_remote, flags.cached_only, - flags.ca_file.clone(), + ca_file, )?; let ts_compiler = TsCompiler::new( |