Skip to content

Commit

Permalink
feat(init): remove -g param
Browse files Browse the repository at this point in the history
  • Loading branch information
fXy-during committed Feb 28, 2020
1 parent fff9b24 commit 1d91a32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/feflow-cli/src/core/native/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ const run = (ctx: any, name: string) => {
module.exports = (ctx: any) => {
ctx.commander.register('init', 'Create a new project', () => {
const { root, rootPkg, args } = ctx;
const { g, generator } = args;
const chooseGenerator = g || generator;
let chooseGeneratorIsValid = false;
const { generator } = args;
const chooseGenerator = generator;
let isValidGenerator = false;

loadGenerator(root, rootPkg).then((generators: any) => {
const options = generators.map((item: any) => {
if (item.name === chooseGenerator) {
chooseGeneratorIsValid = true
isValidGenerator = true
}
return item.desc
});

if(chooseGeneratorIsValid) {
if(isValidGenerator) {
return run(ctx, chooseGenerator);
}

Expand Down

0 comments on commit 1d91a32

Please sign in to comment.