| 29 | } |
| 30 | |
| 31 | export async function onShellCommand(shellCommand: string, projectId: string, promptId: string) { |
| 32 | //npm run build && npm run start |
| 33 | const commands = shellCommand.split("&&"); |
| 34 | for (const command of commands) { |
| 35 | console.log(`Running command: ${command}`); |
| 36 | |
| 37 | ws.send(JSON.stringify({ |
| 38 | event: "admin", |
| 39 | data: { |
| 40 | type: "command", |
| 41 | content: command |
| 42 | } |
| 43 | })) |
| 44 | |
| 45 | await prismaClient.action.create({ |
| 46 | data: { |
| 47 | projectId, |
| 48 | promptId, |
| 49 | content: `Ran command: ${command}`, |
| 50 | }, |
| 51 | }); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | |
| 56 | export function onPromptEnd(promptId: string) { |