-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·54 lines (51 loc) · 1.34 KB
/
index.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
const Listr = require('listr');
function createNFD(project) {
const tasks = new Listr([
{
title: 'Creating project repo',
task: () =>
new Listr([
{
title: `Creating project directory`,
task: () => project.createProjectDirectory()
},
{
title: 'Initialise package.json',
task: () => project.writePackageJSON()
},
{
title: 'Initialise .gitignore',
task: () => project.writeGitIgnore()
}
])
},
{
title: 'Initialising Sanity project',
enabled: () => project.scaffold.includes('Sanity'),
task: () => project.createSanity()
},
{
title: 'Initialising NextJS app',
enabled: () => project.scaffold.includes('NextJS'),
task: () => project.createNextApp()
},
{
title: 'Pushing to GitHub',
enabled: () => project.dryRun === false,
task: () =>
new Listr([
{
title: `Creating a new project for ${project.projectName}`,
task: () => project.createRepo()
},
{
title: 'Push project to github',
enabled: () => project.dryRun === false,
task: () => project.push()
}
])
}
]);
return tasks.run();
}
module.exports = createNFD;