summaryrefslogtreecommitdiff
path: root/cli/tools/info.rs
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-06-28 17:18:21 -0700
committerGitHub <noreply@github.com>2024-06-28 17:18:21 -0700
commitbc8a0e6e68547cf07a246b8b6c886de155dc8282 (patch)
treea3540b01218c4674c399eb770c0f08e5ba594793 /cli/tools/info.rs
parent2ddae872f956ddd84656a302aa5f6b752f6a6ab5 (diff)
refactor(cli): Create wrapper around `deno_lockfile::Lockfile` (#24366)
As suggested in https://github.com/denoland/deno/pull/24355#discussion_r1657875422. I wasn't able to hide the mutex stuff as much as I'd like (ended up just adding an escape hatch `inner()` method that locks the inner mutex), because you can't return references to the inner fields through a mutex. This is mostly motivated by the frozen lockfile changes
Diffstat (limited to 'cli/tools/info.rs')
-rw-r--r--cli/tools/info.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/cli/tools/info.rs b/cli/tools/info.rs
index 17e854519..76951b13d 100644
--- a/cli/tools/info.rs
+++ b/cli/tools/info.rs
@@ -25,7 +25,6 @@ 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;
@@ -71,7 +70,7 @@ pub async fn info(flags: Flags, info_flags: InfoFlags) -> Result<(), AnyError> {
// write out the lockfile if there is one
if let Some(lockfile) = &maybe_lockfile {
graph_exit_lock_errors(&graph);
- write_lockfile_if_has_changes(&mut lockfile.lock())?;
+ lockfile.write_if_changed()?;
}
if info_flags.json {