feat(mod_format): Add check-only formatting with interactive diff preview; make formatting default to dry-run and extend formatting API
This commit is contained in:
@@ -8,10 +8,11 @@ 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() {
|
||||
public static async fromCwd(options: { requireProjectType?: boolean } = {}) {
|
||||
const gitzoneConfig = await GitzoneConfig.fromCwd();
|
||||
const project = new Project(gitzoneConfig);
|
||||
if (!project.gitzoneConfig.data.projectType) {
|
||||
const requireProjectType = options.requireProjectType ?? true;
|
||||
if (requireProjectType && !project.gitzoneConfig.data.projectType) {
|
||||
throw new Error('Please define a project type');
|
||||
}
|
||||
return project;
|
||||
|
||||
Reference in New Issue
Block a user