(params: {
baseReq: ReplayBaseRequest;
positionals: string[];
scope: ReplayVarScope;
})
| 77 | } |
| 78 | |
| 79 | function invokeMaestroRunScript(params: { |
| 80 | baseReq: ReplayBaseRequest; |
| 81 | positionals: string[]; |
| 82 | scope: ReplayVarScope; |
| 83 | }): DaemonResponse { |
| 84 | const [scriptPath] = params.positionals; |
| 85 | if (!scriptPath) { |
| 86 | return errorResponse('INVALID_ARGS', 'runScript requires a file path.'); |
| 87 | } |
| 88 | try { |
| 89 | const outputEnv = executeRunScriptFile({ |
| 90 | scriptPath, |
| 91 | env: { |
| 92 | ...params.scope.values, |
| 93 | ...(params.baseReq.flags?.maestro?.runScriptEnv ?? {}), |
| 94 | }, |
| 95 | }); |
| 96 | return { ok: true, data: { outputEnv } }; |
| 97 | } catch (error) { |
| 98 | const appError = asAppError(error); |
| 99 | return errorResponse(appError.code, appError.message, appError.details); |
| 100 | } |
| 101 | } |
no test coverage detected