-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·36 lines (31 loc) · 744 Bytes
/
cli.js
File metadata and controls
executable file
·36 lines (31 loc) · 744 Bytes
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
#!/usr/bin/env node
import meow from 'meow';
import NodeKickStart from './index.js';
import chalk from 'chalk';
import {isDir} from './utils/validator.js';
const cli = meow(`
Usage
$ node-kickstart <path/of/project>
Options
--name, -n Name of the Project
Examples
$ node-kickstart ./ --name test
`, {
importMeta: import.meta,
flags: {
name: {
type: 'string',
alias: 'n',
default: 'node-kickstart-sample',
isRequired: true
}
}
});
if (!isDir(cli.input[0])) {
console.log(chalk.red('Invalid Path, try again with valid project path.'));
process.exit(0);
}
new NodeKickStart(cli.input[0], cli.flags.name).execute().then(() => {
console.log("Completed, Happy Coding!");
process.exit(0);
});