Skip to content

Commit

Permalink
Fix rust projects with hyphenated names (#663)
Browse files Browse the repository at this point in the history
* Fix rust projects with hyphenated names

* Update RustAsset.js
  • Loading branch information
richard-uk1 authored and devongovett committed Jan 26, 2018
1 parent 1cd3cf7 commit e78baca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/assets/RustAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ class RustAsset extends Asset {

// Get output file paths
let outDir = path.join(cargoDir, 'target', RUST_TARGET, 'release');
let rustName = cargoConfig.package.name;

// Rust converts '-' to '_' when outputting files.
let rustName = cargoConfig.package.name.replace(/-/g, '_');
this.wasmPath = path.join(outDir, rustName + '.wasm');
this.depsPath = path.join(outDir, rustName + '.d');
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/rust-cargo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "cargo"
name = "cargo-test"
version = "0.1.0"
authors = ["josealbizures <albizures3601@gmail.com>"]

[dependencies]

[lib]
crate-type = ["cdylib"]
crate-type = ["cdylib"]

0 comments on commit e78baca

Please sign in to comment.