fix(core): update
This commit is contained in:
28
ts/classes.project.ts
Normal file
28
ts/classes.project.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import * as plugins from './plugins.js'
|
||||
import * as paths from './paths.js';
|
||||
|
||||
import { GitzoneConfig } from './classes.gitzoneconfig.js';
|
||||
import type { TGitzoneProjectType } from './classes.gitzoneconfig.js';
|
||||
|
||||
/**
|
||||
* the Project class is a tool to work with a gitzone project
|
||||
*/
|
||||
export class Project {
|
||||
public static async fromCwd() {
|
||||
const gitzoneConfig = await GitzoneConfig.fromCwd();
|
||||
const project = new Project(gitzoneConfig);
|
||||
if (!project.gitzoneConfig.data.projectType) {
|
||||
throw new Error('Please define a project type');
|
||||
}
|
||||
return project;
|
||||
}
|
||||
|
||||
public gitzoneConfig: GitzoneConfig;
|
||||
public get type(): TGitzoneProjectType {
|
||||
return this.gitzoneConfig.data.projectType;
|
||||
}
|
||||
|
||||
constructor(gitzoneConfigArg: GitzoneConfig) {
|
||||
this.gitzoneConfig = gitzoneConfigArg;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user