Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue #107 and issue #106 #108

Merged
merged 2 commits into from Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/core/index.js
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
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