summaryrefslogtreecommitdiff
path: root/cli/tools/registry/pm.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-10-22 00:08:45 +0100
committerGitHub <noreply@github.com>2024-10-22 01:08:45 +0200
commit67280f8b558902729c805fd3d8f26d4c434fc211 (patch)
tree2d1ed8cb546a56210b6292dd1a2bec0e89d2d8ad /cli/tools/registry/pm.rs
parent9e25a4ebbfa848e58415f267d5991bead7de4808 (diff)
fix(install): update lockfile when using package.json (#26458)
This commit makes sure that `deno add`, `deno install` and `deno remove` update the lockfile if only `package.json` file is present. Fixes https://github.com/denoland/deno/issues/26270
Diffstat (limited to 'cli/tools/registry/pm.rs')
-rw-r--r--cli/tools/registry/pm.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs
index bd5290998..2060b9a13 100644
--- a/cli/tools/registry/pm.rs
+++ b/cli/tools/registry/pm.rs
@@ -723,6 +723,10 @@ async fn npm_install_after_modification(
// npm install
cache_deps::cache_top_level_deps(&cli_factory, jsr_resolver).await?;
+ if let Some(lockfile) = cli_factory.cli_options()?.maybe_lockfile() {
+ lockfile.write_if_changed()?;
+ }
+
Ok(())
}