Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Oct 24, 2024
1 parent 4b062db commit 15b7dca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xtask/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ pub fn step_wasm_bindgen_build<T>(
// TODO: Check for wasm-bindgen on `PATH`
let sh = Shell::new()?;
// let _env = sh.push_env("RUSTFLAGS", crate::RUSTFLAGS);
println!("wasm_path: {}", wasm_path.display());
println!("pkg_directory: {}", pkg_directory.display());
let cmd = cmd!(sh, "wasm-bindgen {wasm_path} --out-dir {pkg_directory} --typescript --target web --split-linked-modules");
println!("wasm-bindgen command: {}", cmd);
println!("working directory: {}", sh.current_dir().display());
pretty_print(cmd, f)?;
Ok(())
}

/// Construct our `pkg` directory in the crate.
pub fn create_pkg_dir<T>(out_dir: &Path, f: impl Fn(&str) -> T) -> Result<()> {
f(&format!("creating package directory {}", out_dir.display()));
println!("creating package directory: {}", out_dir.display());
let _ = fs::remove_file(out_dir.join("package.json")); // Clean up package.json from previous runs
fs::create_dir_all(out_dir)?;
Ok(())
Expand Down

0 comments on commit 15b7dca

Please sign in to comment.