@cortask/core 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3023,7 +3023,9 @@ function exec2(args, timeout = DEFAULT_TIMEOUT) {
|
|
|
3023
3023
|
const isScript = CMD.endsWith(".js");
|
|
3024
3024
|
const cmd = isScript ? process.env.NODE_PATH_BIN || process.execPath : CMD;
|
|
3025
3025
|
const finalArgs = isScript ? [CMD, ...args] : args;
|
|
3026
|
-
|
|
3026
|
+
const env = { ...process.env };
|
|
3027
|
+
delete env.ELECTRON_RUN_AS_NODE;
|
|
3028
|
+
execFile(cmd, finalArgs, { timeout, maxBuffer: 5 * 1024 * 1024, env }, (err, stdout, stderr) => {
|
|
3027
3029
|
if (err) {
|
|
3028
3030
|
const msg = stderr?.trim() || stdout?.trim() || err.message;
|
|
3029
3031
|
reject(new Error(msg));
|
|
@@ -3045,13 +3047,13 @@ async function ensureInstalled() {
|
|
|
3045
3047
|
await exec2(["install"], 12e4);
|
|
3046
3048
|
} catch {
|
|
3047
3049
|
}
|
|
3050
|
+
await exec2(["close"], 5e3).catch(() => {
|
|
3051
|
+
});
|
|
3048
3052
|
_installed = true;
|
|
3049
3053
|
}
|
|
3050
3054
|
async function ensureBrowser() {
|
|
3051
3055
|
if (instance) return instance;
|
|
3052
3056
|
await ensureInstalled();
|
|
3053
|
-
await exec2(["close"], 5e3).catch(() => {
|
|
3054
|
-
});
|
|
3055
3057
|
const inst = {
|
|
3056
3058
|
async run(args) {
|
|
3057
3059
|
return exec2(args);
|