Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.js
More file actions
Latest commit
executable file
·73 lines (60 loc) · 1.59 KB
/
Copy pathindex.js
File metadata and controls
executable file
·73 lines (60 loc) · 1.59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! /usr/bin/env node
const{ Nulla, i18n }=require('./src/modules');
constinquirer=require('inquirer');
const{ program }=require('commander');
const{ version }=require('./package.json');
program
.name('create-nullstack-app')
.version(version,'-v, --version',version)
program.parse();
letprojectName=program.args.map(n=>n.trim()).filter(n=>n).join('_');
inquirer.prompt([
{
type: 'input',
name: 'projectName',
message: i18n.questionName,
when: ()=>!projectName
},
{
type: 'list',
name: 'template',
message: i18n.template.questionName,
choices: [
i18n.template.blank,
i18n.template.blankTs,
i18n.template.tawild,
i18n.template.tawildv4,
i18n.template.tawildTs,
i18n.template.tawildv4Ts,
],
},
])
.then((answers)=>{
letisTS=false;
letisTailwind=false;
lettailwindVersion='v3'
switch(answers.template){
casei18n.template.blankTs:
isTS=true;
break;
casei18n.template.tawild:
isTailwind=true;
break;
casei18n.template.tawildv4:
isTailwind=true;
tailwindVersion="v4";
break;
casei18n.template.tawildTs:
isTS=true;
isTailwind=true;
tailwindVersion='v3'
break;
casei18n.template.tawildv4Ts:
isTS=true;
isTailwind=true;
tailwindVersion='v4';
break;
}
projectName=(projectName||answers.projectName).replace(//g,'_').trim();
Nulla.tryRun(projectName,isTS,isTailwind,tailwindVersion);
});