Skip to content

Commit

Permalink
fix: issue #107 and issue #106 (#108)
Browse files Browse the repository at this point in the history
* fix: feflow cover plugin arguments.

* fix: allow plugin use origin command arguments.
  • Loading branch information
vabaly authored and cpselvis committed Jul 30, 2019
1 parent 67d8c39 commit a28d386
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
5 changes: 4 additions & 1 deletion lib/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class Feflow {
silent: Boolean(args.silent)
});

// Bug: https://github.com/Tencent/feflow/issues/107
this.args = camelizeKeys(args);
// Can use origin arguments.
this.rawArgs = args;

this.cmd = new Command();

Expand Down Expand Up @@ -75,7 +78,7 @@ class Feflow {
require('../internal/deploy')(this);
require('../internal/clean')(this);
require('../internal/create')(this);

// Init client and load external plugins
return Promise.each([
'initClient',
Expand Down
26 changes: 13 additions & 13 deletions lib/feflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ function entry(args) {
}

return feflow.init().then(function () {
let cmd = '';
// outer command
let cmd = args._.shift();

if (args.v || args.version) {
console.log(`v${feflow.version}`);
return;
} else if (!args.h && !args.help) {
cmd = args._.shift();

if (cmd) {
let c = feflow.cmd.get(cmd);
if (!c) cmd = 'help';
// if don't have outer command, maybe have -v or -h arguments.
if (!cmd) {
if (args.v || args.version) {
return console.log(`v${feflow.version}`);
} else if (args.h || args.help) {
cmd = 'help';
} else {
printBanner();
return;
return printBanner();
}
} else {
}

// if command is not registering, replace to 'help' command.
if (!feflow.cmd.get(cmd)) {
cmd = 'help';
}

Expand Down

0 comments on commit a28d386

Please sign in to comment.