mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Add DotAI class
This commit is contained in:
4 files changed
+412
-25
No files matched your search
@@ -2,6 +2,7 @@ import git from 'isomorphic-git';
|
||||
import http from 'isomorphic-git/http/web';
|
||||
import { Buffer } from 'buffer';
|
||||
import type { JSRuntimeFS } from '@/lib/JSRuntime';
|
||||
import { DotAI } from './DotAI';
|
||||
|
||||
// Polyfill Buffer for browser
|
||||
if (typeof window !== 'undefined') {
|
||||
@@ -36,7 +37,10 @@ export class ProjectsManager {
|
||||
}
|
||||
|
||||
async createProject(name: string): Promise<Project> {
|
||||
return this.cloneProject(name, GIT_TEMPLATE_URL);
|
||||
const project = await this.cloneProject(name, GIT_TEMPLATE_URL);
|
||||
const dotAI = new DotAI(this.fs, project.path);
|
||||
await dotAI.setupAiHistoryDir();
|
||||
return project;
|
||||
}
|
||||
|
||||
async cloneProject(name: string, repoUrl: string): Promise<Project> {
|
||||
@@ -74,8 +78,6 @@ export class ProjectsManager {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
async getProjects(): Promise<Project[]> {
|
||||
try {
|
||||
const projectDirs = await this.fs.readdir(this.dir);
|
||||
@@ -259,10 +261,6 @@ export class ProjectsManager {
|
||||
return naddr !== null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private formatProjectName(dirName: string): string {
|
||||
// Return the original directory name without formatting
|
||||
return dirName;
|
||||
|
||||
Reference in new issue
Block a user