diff options
Diffstat (limited to 'cli/npm/resolvers/local.rs')
-rw-r--r-- | cli/npm/resolvers/local.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/npm/resolvers/local.rs b/cli/npm/resolvers/local.rs index bf5b8529c..52a783823 100644 --- a/cli/npm/resolvers/local.rs +++ b/cli/npm/resolvers/local.rs @@ -10,6 +10,7 @@ use std::path::Path; use std::path::PathBuf; use crate::util::fs::symlink_dir; +use crate::util::fs::LaxSingleProcessFsFlag; use async_trait::async_trait; use deno_ast::ModuleSpecifier; use deno_core::anyhow::bail; @@ -236,6 +237,13 @@ async fn sync_resolution_with_fs( format!("Creating '{}'", deno_local_registry_dir.display()) })?; + let single_process_lock = LaxSingleProcessFsFlag::lock( + deno_local_registry_dir.join(".deno.lock"), + // similar message used by cargo build + "waiting for file lock on node_modules directory", + ) + .await; + // 1. Write all the packages out the .deno directory. // // Copy (hardlink in future) <global_registry_cache>/<package_id>/ to @@ -394,6 +402,8 @@ async fn sync_resolution_with_fs( } } + drop(single_process_lock); + Ok(()) } |