Skip to content

Commit 3c9b1ea

Browse files
committed
add an all plaform supported cleanup solution
1 parent 66b05c1 commit 3c9b1ea

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

bin/clean.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env -S node --import tsx
2+
3+
import { rmSync } from "fs";
4+
/*
5+
Some operating systems do not have the ability to perform
6+
rm -rf ... (example: Windows)
7+
*/
8+
9+
rmSync('lib', {'force':true, 'recursive':true})
10+
rmSync('test/tmp', {'force':true, 'recursive':true})
11+
12+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"prebuild-wasm": "npm run wasm -- --prebuild && npm run wasm -- --setup",
1616
"build-wasm": "npm run wasm -- --docker",
1717
"wasm": "node --import tsx bin/build_wasm.ts",
18-
"clean": "rm -rf lib && rm -rf test/tmp",
18+
"clean": "node --import tsx bin/clean.ts",
1919
"prepare": "npm run clean && npm run build-ts",
2020
"test": "node --import tsx ./test/md-test.ts",
2121
"lint": "eslint",

0 commit comments

Comments
 (0)