Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 0545d90

Browse files
committed
fix: fix searching for deno lockfile (#598)
1 parent 17b1561 commit 0545d90

File tree

1 file changed

+7
-10
lines changed
  • packages/toolchain/src/tasks/deploy

1 file changed

+7
-10
lines changed

packages/toolchain/src/tasks/deploy/js.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ pub async fn build_and_upload(
5454
});
5555

5656
// Search for a Deno lockfile
57-
let deno_lockfile_path = ["deno.lock"].iter().find_map(|file_name| {
58-
let path = project_root.join(file_name);
59-
if path.exists() {
60-
Some(path.display().to_string())
61-
} else {
62-
None
63-
}
64-
});
57+
let project_deno_lockfile_path = project_root.join("deno.lock");
58+
let deno_lockfile_path = if project_deno_lockfile_path.exists() {
59+
Some(project_deno_lockfile_path.display().to_string())
60+
} else {
61+
opts.build_config.deno.lock_path.clone()
62+
};
6563

6664
// Build the bundle to the output dir. This will bundle all Deno dependencies into a
6765
// single JS file.
@@ -84,8 +82,7 @@ pub async fn build_and_upload(
8482
.map(|x| project_root.join(x).display().to_string())
8583
}),
8684
import_map_url: opts.build_config.deno.import_map_url.clone(),
87-
lock_path: deno_lockfile_path
88-
.or_else(|| opts.build_config.deno.lock_path.clone()),
85+
lock_path: deno_lockfile_path,
8986
},
9087
bundle: js_utils::schemas::build::Bundle {
9188
minify: opts.build_config.unstable.minify(),

0 commit comments

Comments
 (0)