commit d6b368a2e5194508518e3023afee0ab91d2b85c2
parent b2ec1afcbd4f141bbbdf7cce2d4124cc938332a8
Author: Marcel <mtrnord1@gmail.com>
Date: Sat, 25 Jul 2020 15:20:56 +0200
Improve wasm-clean task
Took 6 minutes
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Makefile.toml b/Makefile.toml
@@ -7,10 +7,15 @@ command = "cargo"
args = ["fmt"]
[tasks.wasm-clean]
-script_runner = "@shell"
+script_runner = "@rust"
script = [
'''
-rm ./dist
+fn main() -> std::io::Result<()> {
+ if std::path::Path::new("./dist").exists() {
+ std::fs::remove_dir_all("./dist")?;
+ }
+ Ok(())
+}
'''
]
@@ -72,6 +77,7 @@ command = "wasm-bindgen"
args = ["--no-typescript", "--debug", "--out-dir", "./dist/", "--target", "no-modules", "--out-name", "worker", "./target/wasm32-unknown-unknown/debug/daydream_worker.wasm"]
[tasks.copy-files]
+# TODO use rust
script_runner = "@shell"
script = [
'''