mirror of
https://github.com/bevyengine/bevy
synced 2024-12-21 18:43:07 +00:00
19 lines
533 B
Rust
19 lines
533 B
Rust
|
use xshell::{cmd, Shell};
|
||
|
|
||
|
fn main() {
|
||
|
let example = std::env::args().nth(1).expect("abbb");
|
||
|
let sh = Shell::new().unwrap();
|
||
|
cmd!(
|
||
|
sh,
|
||
|
"cargo build --release --target wasm32-unknown-unknown --example {example}"
|
||
|
)
|
||
|
.run()
|
||
|
.expect("Error building example");
|
||
|
cmd!(
|
||
|
sh,
|
||
|
"wasm-bindgen --out-dir examples/wasm/target --out-name wasm_example --target web target/wasm32-unknown-unknown/release/examples/{example}.wasm"
|
||
|
)
|
||
|
.run()
|
||
|
.expect("Error creating wasm binding");
|
||
|
}
|