@schemifyjs/core
Version:
Core module of the SchemifyJS CLI. Provides reusable functions such as scaffolding, template handling, and general utilities.
14 lines (13 loc) • 425 B
JavaScript
import fs from 'fs';
import path from 'path';
export class ProjectAlreadyExistsValidator {
static validate(projectPath) {
if (!projectPath) {
throw new Error(`❌ 'projectPath' is required but was undefined.`);
}
const fullPath = path.resolve(projectPath);
if (fs.existsSync(fullPath)) {
throw new Error(`Project already exists at: ${fullPath}`);
}
}
}