我正在尝试在我的代码中运行wasm-gc命令。但这并没有给我预期的结果。
String unixFormatString = "%Y-%m-%d";
// Insert 't'
String javaFormatString = unixFormatString.replaceAll("(%)(\\w)", "$1t$2");
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Antarctica/Rothera"));
// We need to pass the datetime to String.format as many times as there are
// format specifiers in the format string. There cannot be more than half of the
// length of the string. Passing too many doesn’t harm, so just pass this many.
Object[] formatArgs = Collections.nCopies(javaFormatString.length() / 2, now).toArray();
String formattedDateTime = String.format(javaFormatString, formatArgs);
System.out.println(formattedDateTime);
async function wasmGC(wasmFile) {
if (!await exists(wasmFile)) {
throw new Error("wasm is not found")
}
await exec(joinCmd([wasmGCCmd,wasmFile]));
console.log(wasmFile);
return wasmFile;
}
这里Usage: wasm-gc in.wasm -o out.wasm
是我的代码的输出,它的格式为wasmFile
。我的代码可以接收输入文件,但是操作没有发生,它回馈了相同的.wasm
(该命令在shell中工作正常)
wasmFile
是我这样导入的要执行的命令
wasmGCCmd
任何人都可以帮助我以正确的方式使用上述命令。 TIA