MCPcopy
hub / github.com/stackblitz/bolt.new / #runShellAction

Method #runShellAction

app/lib/runtime/action-runner.ts:124–150  ·  view source on GitHub ↗
(action: ActionState)

Source from the content-addressed store, hash-verified

122 }
123
124 async #runShellAction(action: ActionState) {
125 if (action.type !== 'shell') {
126 unreachable('Expected shell action');
127 }
128
129 const webcontainer = await this.#webcontainer;
130
131 const process = await webcontainer.spawn('jsh', ['-c', action.content], {
132 env: { npm_config_yes: true },
133 });
134
135 action.abortSignal.addEventListener('abort', () => {
136 process.kill();
137 });
138
139 process.output.pipeTo(
140 new WritableStream({
141 write(data) {
142 console.log(data);
143 },
144 }),
145 );
146
147 const exitCode = await process.exit;
148
149 logger.debug(`Process terminated with code ${exitCode}`);
150 }
151
152 async #runFileAction(action: ActionState) {
153 if (action.type !== 'file') {

Callers 1

#executeActionMethod · 0.95

Calls 1

unreachableFunction · 0.90

Tested by

no test coverage detected