summaryrefslogtreecommitdiff
path: root/cli/module_loader.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-28 14:58:43 -0400
committerGitHub <noreply@github.com>2024-05-28 14:58:43 -0400
commit448fe67b7a2142f62332b651f9d215534dceb1f5 (patch)
tree3cfc763f39bf275a537e6228767b3e43866f5d0f /cli/module_loader.rs
parentcd8f5f53f7616e4c74de0f1ff5eadd6ef024118a (diff)
feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979)
Includes: * https://github.com/denoland/deno_graph/pull/486 * https://github.com/denoland/deno_graph/pull/488 * https://github.com/denoland/deno_lockfile/pull/25 * https://github.com/denoland/deno_lockfile/pull/22 * https://github.com/denoland/deno_graph/pull/483 * https://github.com/denoland/deno_graph/pull/470
Diffstat (limited to 'cli/module_loader.rs')
-rw-r--r--cli/module_loader.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/cli/module_loader.rs b/cli/module_loader.rs
index 6d8d3e92b..9be1ceff2 100644
--- a/cli/module_loader.rs
+++ b/cli/module_loader.rs
@@ -9,6 +9,7 @@ use std::str;
use std::sync::Arc;
use crate::args::jsr_url;
+use crate::args::write_lockfile_if_has_changes;
use crate::args::CliOptions;
use crate::args::DenoSubcommand;
use crate::args::TsTypeLib;
@@ -20,7 +21,6 @@ use crate::factory::CliFactory;
use crate::graph_container::MainModuleGraphContainer;
use crate::graph_container::ModuleGraphContainer;
use crate::graph_container::ModuleGraphUpdatePermit;
-use crate::graph_util::graph_lock_or_exit;
use crate::graph_util::CreateGraphOptions;
use crate::graph_util::ModuleGraphBuilder;
use crate::node;
@@ -173,13 +173,9 @@ impl ModuleLoadPreparer {
self.module_graph_builder.graph_roots_valid(graph, roots)?;
- // If there is a lockfile...
+ // write the lockfile if there is one
if let Some(lockfile) = &self.lockfile {
- let mut lockfile = lockfile.lock();
- // validate the integrity of all the modules
- graph_lock_or_exit(graph, &mut lockfile);
- // update it with anything new
- lockfile.write().context("Failed writing lockfile.")?;
+ write_lockfile_if_has_changes(&lockfile.lock())?;
}
drop(_pb_clear_guard);