-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
49 lines (39 loc) · 1.28 KB
/
cli.js
File metadata and controls
49 lines (39 loc) · 1.28 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const files = [
'index.html',
'style.css',
'script.js',
'netlify.toml'
];
function init() {
console.log('🚀 Initializing Coming Soon page...\n');
const targetDir = process.cwd();
const sourceDir = __dirname;
files.forEach(file => {
const sourcePath = path.join(sourceDir, file);
const targetPath = path.join(targetDir, file);
if (fs.existsSync(targetPath)) {
console.log(`⚠️ ${file} already exists, skipping...`);
return;
}
try {
fs.copyFileSync(sourcePath, targetPath);
console.log(`✅ Created ${file}`);
} catch (error) {
console.error(`❌ Failed to create ${file}:`, error.message);
}
});
console.log('\n✨ Coming Soon page initialized successfully!');
console.log('\n📝 Next steps:');
console.log(' 1. Customize the social links in script.js');
console.log(' 2. Open index.html in your browser to preview');
console.log(' 3. Deploy to Netlify or your preferred platform\n');
}
const command = process.argv[2];
if (command === 'init' || !command) {
init();
} else {
console.log('Usage: npx @programinglive/comingsoon init');
}