fix(js): do callback on correct type when go compilation fails

reflect
ALI Hamza 2021-03-21 20:48:05 +07:00
parent 92296f6a56
commit 3b119bd81a
Signed by untrusted user: hamza
GPG Key ID: 22473A32291F8CB6
1 changed files with 3 additions and 3 deletions

@ -58,11 +58,11 @@ module.exports = function (source) {
}
const res = await execFile("go", ["build", "-o", outFile, parent], opts)
const result = await execFile("go", ["build", "-o", outFile, parent], opts)
.then(() => true)
.catch(e => e);
if (res instanceof Error) {
return cb(e);
if (result instanceof Error) {
return cb(result);
}
found = await fs.access(wasmSavePath).then(() => true).catch(() => false);