UNPKG

651 BJavaScriptView Raw
1'use strict';
2const path = require('path');
3const PANDORA_LIB_HOME = path.join(__dirname, '../dist');
4const {calcAppName} = require(path.join(PANDORA_LIB_HOME, 'common/Helpers'));
5const cliUtils = require('./util/cliUtils');
6
7exports.command = 'init <filePath>';
8exports.desc = 'Init a Pandora.js project';
9exports.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 * start an app
19 * @param argv
20 */
21exports.handler = function (argv) {
22 const appName = argv.name || calcAppName(process.cwd());
23 cliUtils.initProcfile(argv.filePath, appName);
24};