Commit d00b2eb9 authored by super-lin0's avatar super-lin0

cli init

parent b648f8e1
Pipeline #124 failed with stages
const program = require("commander");
const chalk = require("chalk");
const inquirer = require("inquirer");
program
.version("0.0.1")
.option("-C, --chdir <path>", "change the working directory")
.option("-c, --config <path>", "set config path. defaults to ./deploy.conf")
.option("-T, --no-tests", "ignore test hook");
program
.command("init")
.alias("i")
.description("run remote setup commands")
.action(function() {
console.log(chalk.red("开启前端工程化之路"));
const prompts = [
{
type: "list",
name: "type",
message: "请选择项目类型:",
pageSize: 4,
choices: [
{ name: "Web端项目", value: "web" },
{ name: "PC端项目", value: "pc" },
{ name: "Demo项目", value: "demo" },
{ name: "Blank项目", value: "blank" },
{ name: "Test项目", value: "test" },
{ name: "Mobile端项目", value: "mobile" }
]
}
];
inquirer.prompt(prompts).then(answers => {
console.log("Hello, world", answers);
console.log(chalk.green("收工咯"));
console.log(chalk.blue("收工咯"));
console.log(chalk.blue.bgRed("收工咯")); //支持设置背景
console.log(chalk.blue(JSON.stringify(answers)));
});
});
// program
// .command("exec <cmd>")
// .description("run the given remote command")
// .action(function(cmd) {
// console.log('exec "%s"', cmd);
// });
// program
// .command("teardown <dir> [otherDirs...]")
// .description("run teardown commands")
// .action(function(dir, otherDirs) {
// console.log('dir "%s"', dir);
// if (otherDirs) {
// otherDirs.forEach(function(oDir) {
// console.log('dir "%s"', oDir);
// });
// }
// });
// program
// .command("*")
// .description("deploy the given env")
// .action(function(env) {
// console.log('deploying "%s"', env);
// });
program.parse(process.argv);
{
"name": "nemean-cli",
"version": "1.0.4",
"version": "1.0.5",
"main": "src/index.js",
"bin": "bin/npmrc.js",
"license": "ISC",
"author": "super-lin",
"scripts": {
......@@ -13,6 +14,5 @@
"fs-extra": "^8.1.0",
"inquirer": "^7.0.0",
"shelljs": "^0.8.3"
},
"bin": "bin/npmrc.js"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment