MCPcopy Create free account
hub / github.com/MigoXLab/coderio / initWorkspace

Method initWorkspace

src/utils/workspace.ts:23–48  ·  view source on GitHub ↗
(subPath: string, rootPath?: string, appName?: string)

Source from the content-addressed store, hash-verified

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

Callers 6

design2codeFunction · 0.80
registerValidateCommandFunction · 0.80
registerD2PCommandFunction · 0.80
registerImagesCommandFunction · 0.80
registerP2CCommandFunction · 0.80
workspace.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected