summaryrefslogtreecommitdiff
path: root/cli/tools/info.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/tools/info.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/tools/info.rs')
-rw-r--r--cli/tools/info.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/cli/tools/info.rs b/cli/tools/info.rs
index 19975571b..b023970f8 100644
--- a/cli/tools/info.rs
+++ b/cli/tools/info.rs
@@ -7,7 +7,6 @@ use std::fmt::Write;
use deno_ast::ModuleSpecifier;
use deno_core::anyhow::bail;
-use deno_core::anyhow::Context;
use deno_core::error::AnyError;
use deno_core::resolve_url_or_path;
use deno_core::serde_json;
@@ -26,11 +25,12 @@ use deno_semver::npm::NpmPackageReqReference;
use deno_semver::package::PackageNv;
use deno_terminal::colors;
+use crate::args::write_lockfile_if_has_changes;
use crate::args::Flags;
use crate::args::InfoFlags;
use crate::display;
use crate::factory::CliFactory;
-use crate::graph_util::graph_lock_or_exit;
+use crate::graph_util::graph_exit_lock_errors;
use crate::npm::CliNpmResolver;
use crate::npm::ManagedCliNpmResolver;
use crate::util::checksum;
@@ -68,13 +68,10 @@ pub async fn info(flags: Flags, info_flags: InfoFlags) -> Result<(), AnyError> {
.create_graph_with_loader(GraphKind::All, vec![specifier], &mut loader)
.await?;
- // If there is a lockfile...
+ // write out the lockfile if there is one
if let Some(lockfile) = &maybe_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.")?;
+ graph_exit_lock_errors(&graph);
+ write_lockfile_if_has_changes(&lockfile.lock())?;
}
if info_flags.json {
@@ -669,18 +666,6 @@ impl<'a> GraphDisplayContext<'a> {
ModuleError::Missing(_, _) | ModuleError::MissingDynamic(_, _) => {
self.build_error_msg(specifier, "(missing)")
}
- ModuleError::MissingWorkspaceMemberExports { .. } => {
- self.build_error_msg(specifier, "(missing exports)")
- }
- ModuleError::UnknownExport { .. } => {
- self.build_error_msg(specifier, "(unknown export)")
- }
- ModuleError::UnknownPackage { .. } => {
- self.build_error_msg(specifier, "(unknown package)")
- }
- ModuleError::UnknownPackageReq { .. } => {
- self.build_error_msg(specifier, "(unknown package constraint)")
- }
}
}