forked from DhiWise/nodejs-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·22 lines (21 loc) · 769 Bytes
/
index.js
File metadata and controls
executable file
·22 lines (21 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/env node
let program = require('commander');
const path = require('path');
const prompts = require('prompts');
global.__basedir = __dirname;
const constant = require('./questions/index');
const codeGenerator = require('./codeGenerator');
async function main() {
try {
let destinationPath = program.args.shift() || '.'
// App name
let projectPath = path.resolve(destinationPath);
let projectType = await prompts(constant.SELECT_PROJECT_TYPE);
let ormType = await prompts(constant.SELECT_ORM_TYPE);
const codeGen = new codeGenerator({ projectType: projectType.value, ormType: ormType.value });
await codeGen.updateApp({projectPath})
} catch (error) {
console.log(error);
}
}
main();