MCPcopy Create free account
hub / github.com/SKaplanOfficial/Raycast-PromptLab / runScript

Function runScript

src/lib/commands/command-utils.ts:52–71  ·  view source on GitHub ↗
(script: string)

Source from the content-addressed store, hash-verified

50 );
51 } else if (type == "zsh") {
52 const runScript = (script: string): Promise<string> => {
53 const shellScript = `response="${response.trim().replaceAll('"', '\\"').replaceAll("\n", "\\n")}"
54 prompt="${prompt.trim().replaceAll('"', '\\"').replaceAll("\n", "\\n")}"
55 input="${input.trim().replaceAll('"', '\\"').replaceAll("\n", "\\n")}"
56 ${script.replaceAll("\n", " && ")}`;
57
58 return new Promise((resolve, reject) => {
59 PLApplicator.bulkApply(shellScript, { customPlaceholders, defaultPlaceholders: PromptLabPlaceholders }).then(
60 (subbedScript) => {
61 exec(subbedScript, (error, stdout) => {
62 if (error) {
63 reject(error);
64 return;
65 }
66 resolve(stdout);
67 });
68 },
69 );
70 });
71 };
72 await runScript(script);
73 }
74 } catch (error) {

Callers 1

runActionScriptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected