feat(P03): multi-project support, NFR milestone versioning, phase context reset, install scripts (v0.3.0)
This commit is contained in:
+14
-1
@@ -62,11 +62,24 @@ export function isCIInitialized(projectPath: string): boolean {
|
||||
return fs.existsSync(ciDir) && fs.existsSync(configPath);
|
||||
}
|
||||
|
||||
export function initCI(projectPath: string, config?: Partial<CIConfig>): CIConfig {
|
||||
export function initCI(projectPath: string, config?: Partial<CIConfig>, projectSlug?: string, projectName?: string): CIConfig {
|
||||
ensureCIDir(projectPath);
|
||||
|
||||
let projects = config?.projects || DEFAULT_CI_CONFIG.projects;
|
||||
let activeProject = config?.active_project || DEFAULT_CI_CONFIG.active_project;
|
||||
|
||||
if (projectSlug) {
|
||||
if (!projects.some((p) => p.slug === projectSlug)) {
|
||||
projects = [...projects, { slug: projectSlug, name: projectName || projectSlug, default: projects.length === 0 }];
|
||||
}
|
||||
activeProject = projectSlug;
|
||||
}
|
||||
|
||||
const fullConfig: CIConfig = {
|
||||
...DEFAULT_CI_CONFIG,
|
||||
...config,
|
||||
projects,
|
||||
active_project: activeProject,
|
||||
autonomy: { ...DEFAULT_CI_CONFIG.autonomy, ...config?.autonomy },
|
||||
parallelization: {
|
||||
...DEFAULT_CI_CONFIG.parallelization,
|
||||
|
||||
Reference in New Issue
Block a user