1 | 'use strict';
|
2 | const path = require('path');
|
3 | const PANDORA_LIB_HOME = path.join(__dirname, '../dist');
|
4 | const {calcAppName} = require(path.join(PANDORA_LIB_HOME, 'common/Helpers'));
|
5 | const cliUtils = require('./util/cliUtils');
|
6 |
|
7 | exports.command = 'init <filePath>';
|
8 | exports.desc = 'Init a Pandora.js project';
|
9 | exports.builder = (yargs) => {
|
10 |
|
11 | yargs.option('name', {
|
12 | alias: 'n',
|
13 | describe: 'App name, it will get a name from process.cwd() by default'
|
14 | });
|
15 |
|
16 | };
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | exports.handler = function (argv) {
|
22 | const appName = argv.name || calcAppName(process.cwd());
|
23 | cliUtils.initProcfile(argv.filePath, appName);
|
24 | };
|