@base44-preview/cli 0.0.37-pr.357.8ea004a → 0.0.37-pr.357.9a73e6e

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/cli/index.js CHANGED
@@ -244354,7 +244354,7 @@ function getDevCommand(context) {
244354
244354
 
244355
244355
  // src/cli/commands/exec.ts
244356
244356
  import { spawn as spawn3, spawnSync as spawnSync3 } from "node:child_process";
244357
- import { unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
244357
+ import { copyFileSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
244358
244358
  import { tmpdir as tmpdir2 } from "node:os";
244359
244359
  import { dirname as dirname12, join as join16, resolve as resolve6 } from "node:path";
244360
244360
  import { fileURLToPath as fileURLToPath8 } from "node:url";
@@ -244384,7 +244384,6 @@ function readStdin() {
244384
244384
  });
244385
244385
  }
244386
244386
  async function execAction(scriptArg, options8, extraArgs) {
244387
- verifyDenoIsInstalled();
244388
244387
  let scriptPath;
244389
244388
  let tempFile = null;
244390
244389
  const hasFile = scriptArg !== undefined;
@@ -244402,6 +244401,7 @@ async function execAction(scriptArg, options8, extraArgs) {
244402
244401
  ]
244403
244402
  });
244404
244403
  }
244404
+ verifyDenoIsInstalled();
244405
244405
  if (hasFile) {
244406
244406
  scriptPath = `file://${resolve6(scriptArg)}`;
244407
244407
  } else {
@@ -244418,15 +244418,28 @@ async function execAction(scriptArg, options8, extraArgs) {
244418
244418
  } catch (error48) {
244419
244419
  throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
244420
244420
  }
244421
+ let appBaseUrl;
244422
+ try {
244423
+ appBaseUrl = await getSiteUrl();
244424
+ } catch {}
244425
+ const tempWrapper = join16(tmpdir2(), `base44-exec-wrapper-${Date.now()}.js`);
244426
+ copyFileSync(EXEC_WRAPPER_PATH, tempWrapper);
244421
244427
  try {
244422
244428
  const exitCode = await new Promise((resolvePromise) => {
244423
- const child = spawn3("deno", ["run", "--allow-all", "--node-modules-dir=auto", EXEC_WRAPPER_PATH, ...extraArgs], {
244429
+ const child = spawn3("deno", [
244430
+ "run",
244431
+ "--allow-all",
244432
+ "--node-modules-dir=auto",
244433
+ tempWrapper,
244434
+ ...extraArgs
244435
+ ], {
244424
244436
  env: {
244425
244437
  ...process.env,
244426
244438
  SCRIPT_PATH: scriptPath,
244427
244439
  BASE44_APP_ID: appConfig.id,
244428
244440
  BASE44_ACCESS_TOKEN: appUserToken,
244429
- BASE44_API_URL: getBase44ApiUrl()
244441
+ BASE44_API_URL: getBase44ApiUrl(),
244442
+ ...appBaseUrl ? { BASE44_APP_BASE_URL: appBaseUrl } : {}
244430
244443
  },
244431
244444
  stdio: "inherit"
244432
244445
  });
@@ -244438,10 +244451,12 @@ async function execAction(scriptArg, options8, extraArgs) {
244438
244451
  process.exitCode = exitCode;
244439
244452
  }
244440
244453
  } finally {
244441
- if (tempFile) {
244442
- try {
244443
- unlinkSync(tempFile);
244444
- } catch {}
244454
+ for (const f7 of [tempFile, tempWrapper]) {
244455
+ if (f7) {
244456
+ try {
244457
+ unlinkSync(f7);
244458
+ } catch {}
244459
+ }
244445
244460
  }
244446
244461
  }
244447
244462
  return {};
@@ -248809,4 +248824,4 @@ export {
248809
248824
  CLIExitError
248810
248825
  };
248811
248826
 
248812
- //# debugId=8D11C7597C91089364756E2164756E21
248827
+ //# debugId=B22F385C624D714C64756E2164756E21