baseline style v2

This commit is contained in:
Chad Curtis committed 2025-07-21 01:50:10 +00:00
1 parent 03109e63b5
commit f58bc266d6
7 files changed
+799 -163

No files matched your search

+31
View File
@@ -179,6 +179,37 @@ export class ProjectsManager {
}
}
async deleteProject(projectId: string): Promise<void> {
const projectPath = `${this.dir}/${projectId}`;
// Recursively delete the project directory
await this.deleteDirectory(projectPath);
}
private async deleteDirectory(dirPath: string): Promise<void> {
try {
const files = await this.fs.readdir(dirPath);
for (const file of files) {
const fullPath = `${dirPath}/${file}`;
const stat = await this.fs.stat(fullPath);
if (stat.isDirectory()) {
await this.deleteDirectory(fullPath);
} else {
await this.fs.unlink(fullPath);
}
}
await this.fs.rmdir(dirPath);
} catch (error) {
const fsError = error as NodeJS.ErrnoException;
if (fsError.code !== 'ENOENT') {
throw error;
}
}
}
private generateProjectId(name: string): string {
const timestamp = Date.now().toString(36);
const slug = name