File size: 923 Bytes
af22ce3
 
 
 
 
 
 
bce2498
 
 
 
 
 
 
 
af22ce3
bce2498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.');