@cortask/core 0.2.32 → 0.2.34

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 CHANGED
@@ -3025,7 +3025,8 @@ function exec2(args, timeout = DEFAULT_TIMEOUT) {
3025
3025
  const finalArgs = isScript ? [CMD, ...args] : args;
3026
3026
  const env = { ...process.env };
3027
3027
  delete env.ELECTRON_RUN_AS_NODE;
3028
- execFile(cmd, finalArgs, { timeout, maxBuffer: 5 * 1024 * 1024, env }, (err, stdout, stderr) => {
3028
+ const cwd = ensureAgentBrowserHome();
3029
+ execFile(cmd, finalArgs, { timeout, maxBuffer: 5 * 1024 * 1024, env, cwd }, (err, stdout, stderr) => {
3029
3030
  if (err) {
3030
3031
  const msg = stderr?.trim() || stdout?.trim() || err.message;
3031
3032
  reject(new Error(msg));
@@ -3047,13 +3048,13 @@ async function ensureInstalled() {
3047
3048
  await exec2(["install"], 12e4);
3048
3049
  } catch {
3049
3050
  }
3051
+ await exec2(["close"], 5e3).catch(() => {
3052
+ });
3050
3053
  _installed = true;
3051
3054
  }
3052
3055
  async function ensureBrowser() {
3053
3056
  if (instance) return instance;
3054
3057
  await ensureInstalled();
3055
- await exec2(["close"], 5e3).catch(() => {
3056
- });
3057
3058
  const inst = {
3058
3059
  async run(args) {
3059
3060
  return exec2(args);