-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·51 lines (38 loc) · 1.22 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
#!/usr/bin/env node
const chalk = require('chalk')
const clear = require('clear')
const figlet = require('figlet')
const config = require('./config')
const minimist = require('minimist')
const createProcess = require('./packs/createProcess')
clear();
console.log(
chalk.green(
figlet.textSync(config.public.name, { horizontalLayout: 'full' })
)
);
// console.log(chalk.yellow("\n> - - - - -\n"))
// console.log(chalk.yellow("configuration:"))
// console.log(chalk.yellow(JSON.stringify(config, null, 2)))
// console.log(chalk.yellow("\n> - - - - -\n"))
const run = async () => {
try {
//TODO: check if we are in a git repository - We cannot proceed then :-(
// or can we?
// if (files.directoryExists('.git')) {
// console.log(chalk.red('Already a git repository!'));
// process.exit();
// }
const args = minimist(process.argv.slice(2))
// console.log(chalk.yellow("caught arguments are: " + args._))
done = await createProcess.execute(args._[0], args._[1], args._[2])
if(done) {
console.log(chalk.green('All done!\n'));
}
} catch(err) {
console.log(chalk.red('Error!'));
console.log(err)
console.log("\n")
}
}
run();