-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblush.js
executable file
·66 lines (60 loc) · 1.25 KB
/
blush.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#! /usr/bin/env node
const os = require('os')
const fs = require('fs')
const shell = require("shelljs")
const path = require('path');
const inquirer = require("inquirer")
const figlet = require("figlet")
const generator = require('./generator.js')
const folderpath = path.join(os.homedir(),'blush-js')
//Clones source code in homedir
if (fs.existsSync(folderpath)){
blush();
}
else{
shell.exec(`git clone https://github.com/ps173/blush-js.git ${folderpath}`)
blush();
}
const question = [
{
type:'checkbox',
name:"files",
message:"What do you want in the file",
choices: [
{
name:"Navbar",
},
{
name:"Hero"
},
{
name:"Article"
},
{
name:"Footer"
}
],
validate: function(answer){
if(answer.length < 1){
return 'Select atleast one'
}
return true;
}
}
]
function blush(){
//Ascii art
figlet("BLUSH-JS",(err,data)=>{
if(err){
console.log("some error")
}
else{
console.log(data)
// generate css and html accordingly
inquirer.prompt(question).then(({files})=>{
generator.generateFiles("css",folderpath,files)
generator.generateFiles("html",folderpath,files)
})
}
})
}