(subPath: string, rootPath?: string, appName?: string)
| 21 | path: WorkspaceStructure | null = null; |
| 22 | |
| 23 | initWorkspace(subPath: string, rootPath?: string, appName?: string): WorkspaceStructure { |
| 24 | if (this.path) { |
| 25 | return this.path; |
| 26 | } |
| 27 | |
| 28 | const root = rootPath || (process.env.CODERIO_CLI_USER_CWD ?? process.cwd()); |
| 29 | const coderioRoot = path.join(root, 'coderio'); |
| 30 | const finalRoot = path.resolve(coderioRoot, subPath); |
| 31 | const app = appName || 'my-app'; |
| 32 | |
| 33 | const absoluteRoot = path.resolve(finalRoot); |
| 34 | const processDir = path.join(absoluteRoot, 'process'); |
| 35 | const checkpointDir = path.join(absoluteRoot, 'checkpoint'); |
| 36 | const debugDir = path.join(absoluteRoot, 'debug'); |
| 37 | |
| 38 | this.path = { |
| 39 | root: absoluteRoot, |
| 40 | app: path.join(absoluteRoot, app), |
| 41 | process: processDir, |
| 42 | debug: debugDir, |
| 43 | reports: path.join(absoluteRoot, 'reports.html'), |
| 44 | db: path.join(checkpointDir, 'coderio-cli.db'), |
| 45 | checkpoint: path.join(checkpointDir, 'checkpoint.json'), |
| 46 | }; |
| 47 | return this.path; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Delete all files and directories inside the workspace |
no outgoing calls
no test coverage detected