@writepanda/cli 1.180.0 → 1.191.0

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.
@@ -485,6 +485,28 @@ function findInstalledApp(appOverride) {
485
485
  return candidates.find((c) => existsSync(c)) ?? candidates[0];
486
486
  }
487
487
 
488
+ /** Environment for launching the desktop app. The bundled launcher runs this
489
+ * CLI as Electron in node mode (ELECTRON_RUN_AS_NODE=1); inherited, that made
490
+ * "launch PandaStudio" start a Node REPL that exits at once, so auto-launch
491
+ * always ended in "did not become ready". Drop it (and the in-app markers). */
492
+ function appLaunchEnv(env) {
493
+ const out = {};
494
+ for (const [k, v] of Object.entries(env)) {
495
+ const upper = k.toUpperCase();
496
+ if (
497
+ upper === "ELECTRON_RUN_AS_NODE" ||
498
+ upper === "ELECTRON_NO_ATTACH_CONSOLE" ||
499
+ upper === "PANDASTUDIO_CALLER" ||
500
+ upper === "PANDASTUDIO_AUTOMATION_PORT" ||
501
+ upper === "PANDASTUDIO_AUTOMATION_TOKEN"
502
+ ) {
503
+ continue;
504
+ }
505
+ out[k] = v;
506
+ }
507
+ return out;
508
+ }
509
+
488
510
  async function autoLaunchAndWait(opts, log) {
489
511
  const bin = findInstalledApp(opts.appOverride);
490
512
  log(`auto-launching ${bin}`);
@@ -492,7 +514,7 @@ async function autoLaunchAndWait(opts, log) {
492
514
  const child = spawn(bin, [], {
493
515
  detached: true,
494
516
  stdio: "ignore",
495
- env: process.env,
517
+ env: appLaunchEnv(process.env),
496
518
  });
497
519
  child.unref();
498
520
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@writepanda/cli",
3
- "version": "1.180.0",
3
+ "version": "1.191.0",
4
4
  "description": "Drive PandaStudio (a desktop video editor for YouTube creators) from the command line. Talks to a localhost HTTP API the desktop app exposes.",
5
5
  "keywords": [
6
6
  "pandastudio",