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

Commit

Permalink
fix: fix searching for deno lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Dec 1, 2024
1 parent 375a4cf commit 84068f3
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/toolchain/src/tasks/deploy/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ pub async fn build_and_upload(
});

// Search for a Deno lockfile
let deno_lockfile_path = ["deno.lock"].iter().find_map(|file_name| {
let path = project_root.join(file_name);
if path.exists() {
Some(path.display().to_string())
} else {
None
}
});
let project_deno_lockfile_path = project_root.join("deno.lock");
let deno_lockfile_path = if project_deno_lockfile_path.exists() {
Some(project_deno_lockfile_path.display().to_string())
} else {
opts.build_config.deno.lock_path.clone()
};

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

0 comments on commit 84068f3

Please sign in to comment.