From 448fe67b7a2142f62332b651f9d215534dceb1f5 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 28 May 2024 14:58:43 -0400 Subject: 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 --- cli/module_loader.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cli/module_loader.rs') 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); -- cgit v1.2.3