(r: RunningServer)
| 118 | } |
| 119 | |
| 120 | async function createSession(r: RunningServer): Promise<string> { |
| 121 | const res = await appOf(r).inject({ |
| 122 | method: 'POST', |
| 123 | url: '/api/v1/sessions', |
| 124 | payload: { metadata: { cwd: workspace } }, |
| 125 | }); |
| 126 | const env = envelopeOf<{ id: string }>(res.json()); |
| 127 | if (env.code !== 0 || env.data === null) { |
| 128 | throw new Error(`create session failed: ${JSON.stringify(env)}`); |
| 129 | } |
| 130 | return env.data.id; |
| 131 | } |
| 132 | |
| 133 | function git(args: string[]): void { |
| 134 | execFileSync('git', args, { |
no test coverage detected