dawit45's picture
Update scripts/setup-vault.js
af22ce3 verified
raw
history blame contribute delete
923 Bytes
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
// Define __dirname for ES Module scope
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const dirs = [
'src/store',
'src/components',
'public',
'dist'
];
console.log('--- Abyssinia v15 Repository Initialization (ESM) ---');
dirs.forEach(dir => {
const fullPath = path.join(__dirname, '..', dir);
if (!fs.existsSync(fullPath)) {
fs.mkdirSync(fullPath, { recursive: true });
console.log(`Verified: ${dir}`);
}
});
// Logic to prevent nested src/components/src errors
const nestedPath = path.join(__dirname, '..', 'src/components/src');
if (fs.existsSync(nestedPath)) {
console.log('Warning: Detected nested src directory. Correcting pathing...');
fs.rmSync(nestedPath, { recursive: true, force: true });
}
console.log('System: Architecture validated for build.');