summaryrefslogtreecommitdiff
path: root/cli/program_state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/program_state.rs')
-rw-r--r--cli/program_state.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/program_state.rs b/cli/program_state.rs
index 264b22729..6775b2276 100644
--- a/cli/program_state.rs
+++ b/cli/program_state.rs
@@ -61,8 +61,11 @@ pub struct ProgramState {
impl ProgramState {
pub async fn build(flags: flags::Flags) -> Result<Arc<Self>, AnyError> {
- let custom_root = env::var("DENO_DIR").map(String::into).ok();
- let dir = deno_dir::DenoDir::new(custom_root)?;
+ let maybe_custom_root = flags
+ .cache_path
+ .clone()
+ .or_else(|| env::var("DENO_DIR").map(String::into).ok());
+ let dir = deno_dir::DenoDir::new(maybe_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").ok());