()
| 57 | } |
| 58 | |
| 59 | async function ensureConfigured(): Promise<void> { |
| 60 | const files = loadDevspaceFiles(); |
| 61 | if (files.configExists && files.authExists) return; |
| 62 | if (process.env.DEVSPACE_OAUTH_OWNER_TOKEN) return; |
| 63 | |
| 64 | if (!input.isTTY || !output.isTTY) { |
| 65 | throw new Error( |
| 66 | [ |
| 67 | "DevSpace is not configured and this terminal is non-interactive.", |
| 68 | "", |
| 69 | "Run:", |
| 70 | " devspace init", |
| 71 | "", |
| 72 | "Or provide DEVSPACE_OAUTH_OWNER_TOKEN and DEVSPACE_ALLOWED_ROOTS.", |
| 73 | ].join("\n"), |
| 74 | ); |
| 75 | } |
| 76 | |
| 77 | await runInit({ force: false }); |
| 78 | } |
| 79 | |
| 80 | async function runInit({ force }: { force: boolean }): Promise<void> { |
| 81 | const files = loadDevspaceFiles(); |
no test coverage detected