Skip to content

Commit

Permalink
fix(cargo): use target name to find wasm file (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Nov 21, 2024
1 parent 26da1d7 commit df1f342
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions balius/src/bin/cargo-balius.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ fn get_project_info() -> (PathBuf, String) {

let package_name = package["name"].as_str().unwrap().to_string();

let package_name = package["targets"]
.as_array()
.unwrap()
.iter()
.find(|t| {
t["kind"]
.as_array()
.unwrap()
.contains(&Value::String("cdylib".to_string()))
})
.map(|t| t["name"].as_str().unwrap().to_string())
.unwrap_or_default();

(target_directory, package_name)
}

Expand Down

0 comments on commit df1f342

Please sign in to comment.