Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (args: any) => {
checkIsOutdated()
loadEnv(path.join(process.cwd(), "electron-builder.env"))
.then(() => task(args))
.catch(error => {
process.exitCode = 1
// https://github.com/electron-userland/electron-builder/issues/2940
process.on("exit", () => process.exitCode = 1)
if (error instanceof InvalidConfigurationError) {
log.error(null, error.message)
}
else if (!(error instanceof ExecError) || !error.alreadyLogged) {
log.error({stackTrace: error.stack}, error.message)
}
})
}
}