(version: string)
| 8 | import { getWorkspacesDir } from '../home.js'; |
| 9 | |
| 10 | export function workspaces(version: string): void { |
| 11 | const workspacesDir = getWorkspacesDir(); |
| 12 | const image = getWorkerImage(version); |
| 13 | |
| 14 | try { |
| 15 | execFileSync( |
| 16 | 'docker', |
| 17 | [ |
| 18 | 'run', |
| 19 | '--rm', |
| 20 | '-v', |
| 21 | `${workspacesDir}:/app/workspaces`, |
| 22 | '-e', |
| 23 | 'WORKSPACES_DIR=/app/workspaces', |
| 24 | image, |
| 25 | 'node', |
| 26 | 'apps/worker/dist/temporal/workspaces.js', |
| 27 | ], |
| 28 | { stdio: 'inherit', ...(os.platform() === 'win32' && { env: { ...process.env, MSYS_NO_PATHCONV: '1' } }) }, |
| 29 | ); |
| 30 | } catch { |
| 31 | console.error('ERROR: Failed to list workspaces. Is the Docker image available?'); |
| 32 | console.error(` Run: docker pull ${image}`); |
| 33 | process.exit(1); |
| 34 | } |
| 35 | } |
no test coverage detected