-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
executable file
·53 lines (41 loc) · 1.06 KB
/
main.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
#!/usr/bin/env node
const { args, copy, run } = require(`./lib`)
const start = async () => {
const { argv } = args()
const results = []
if (!argv['skip-init']) {
results.push(await run.yarnInit())
}
if (!argv['skip-add']) {
results.push(await run.yarnAdd())
}
if (!argv['skip-package-json']) {
results.push(await run.packagejson())
}
if (!argv['skip-copy-config']) {
results.push(await copy.config())
}
if (!argv['skip-copy-src']) {
results.push(await copy.src())
}
if (!argv['skip-copy-jest']) {
results.push(await copy.jest())
}
if (!argv['skip-copy-tests']) {
results.push(await copy.tests())
}
if (!argv['skip-build']) {
results.push(await run.build())
}
if (!argv['skip-test']) {
results.push(await run.jest())
}
if (results.every((r) => r)) {
console.log(`\n`)
console.log(`Everything seems to fly. Happy coding...\n`)
} else {
console.log(`\n`)
console.log(`Something wasn't correct. Check output above...\n`)
}
}
start().catch((e) => console.error(`Main error:`, e))