MCPcopy Index your code
hub / github.com/CapSoftware/Cap / launchDesktopApp

Function launchDesktopApp

scripts/verify-recording-pipeline.mjs:665–695  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

663}
664
665async function launchDesktopApp() {
666 if (desktopExecPath) {
667 const stdoutPath = outputPath("desktop-launch-exec", "stdout");
668 const stderrPath = outputPath("desktop-launch-exec", "stderr");
669 summary.desktop.execStdoutPath = stdoutPath;
670 summary.desktop.execStderrPath = stderrPath;
671 const stdoutFd = fs.openSync(stdoutPath, "a");
672 const stderrFd = fs.openSync(stderrPath, "a");
673 const child = spawn(desktopExecPath, [], {
674 cwd: root,
675 env: process.env,
676 detached: true,
677 stdio: ["ignore", stdoutFd, stderrFd],
678 });
679 fs.closeSync(stdoutFd);
680 fs.closeSync(stderrFd);
681 child.unref();
682 summary.desktop.execPid = child.pid;
683 await sleep(
684 Number(process.env.CAP_VERIFY_DESKTOP_LAUNCH_WAIT_MS || "5000"),
685 );
686 return;
687 }
688
689 if (!desktopAppPath) {
690 return;
691 }
692
693 await runCommand("desktop-launch-app", "open", [desktopAppPath]);
694 await sleep(Number(process.env.CAP_VERIFY_DESKTOP_LAUNCH_WAIT_MS || "5000"));
695}
696
697async function waitForDesktopProject(before) {
698 const deadline =

Callers 1

verifyDesktopFunction · 0.85

Calls 3

outputPathFunction · 0.85
runCommandFunction · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected