MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / clean_wasm

Function clean_wasm

tools/cargo-run/src/frontend.rs:81–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 steps.push(cmd!("wasm-opt", "-O3", "-g", &wasm_file, "-o", &wasm_file));
80 }
81
82 steps
83}
84
85pub fn clean_wasm() -> bool {
86 let wasm_target_dir = target_dir().join(WASM_TARGET);
87 eprintln!("The Wasm build emitted undefined `env` imports, a sign of corrupt incremental artifacts (typically from an interrupted build).");
88 eprintln!("Fixing by wiping `{}` and rebuilding...", wasm_target_dir.display());
89 match std::fs::remove_dir_all(&wasm_target_dir) {
90 Ok(()) => {}
91 Err(e) if e.kind() == std::io::ErrorKind::NotFound => {}
92 Err(e) => eprintln!("warning: could not fully clean `{}`: {e}", wasm_target_dir.display()),
93 }
94 true

Callers

nothing calls this directly

Calls 2

target_dirFunction · 0.85
kindMethod · 0.80

Tested by

no test coverage detected