Skip to content

Commit a6c10c4

Browse files
added err handling for rm cmd (Windows issue)
1 parent 884e091 commit a6c10c4

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

packages/react-scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scripts-rust",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Configuration and scripts for using Rust with Create React App",
55
"repository": "thomashorrobin/create-react-app-rust",
66
"license": "MIT",
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
const execSync = require('child_process').execSync;
22

33
module.exports = () => {
4-
execSync(
5-
'rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib src/lib.rs -o public/app.big.wasm && wasm-gc public/app.big.wasm public/app.wasm'
6-
// 'rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib src/lib.rs -o public/app.big.wasm && wasm-gc public/app.big.wasm public/app.wasm && rm public/app.big.wasm'
7-
);
4+
try {
5+
execSync(
6+
'rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib src/lib.rs -o public/app.big.wasm && wasm-gc public/app.big.wasm public/app.wasm && rm public/app.big.wasm'
7+
);
8+
} catch (error) {
9+
execSync(
10+
'rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib src/lib.rs -o public/app.big.wasm && wasm-gc public/app.big.wasm public/app.wasm'
11+
);
12+
}
813
};

0 commit comments

Comments
 (0)