@fivethree/billy-core
Advanced tools
Comparing version 0.15.1 to 0.15.2
@@ -36,2 +36,7 @@ "use strict"; | ||
this.controller.commands.forEach(command => this.command(command)); | ||
if (onStart) { | ||
this.controller.params | ||
.filter(param => param.propertyKey === onStart.lane.name) | ||
.forEach(p => this.param(commander_1.default, p)); | ||
} | ||
commander_1.default.on("command:*", args => { | ||
@@ -46,7 +51,2 @@ if (onStart) { | ||
}); | ||
if (onStart) { | ||
this.controller.params | ||
.filter(param => param.propertyKey === onStart.lane.name) | ||
.forEach(p => this.param(commander_1.default, p)); | ||
} | ||
const command = commander_1.default.parse(process.argv); | ||
@@ -68,5 +68,9 @@ if (command.args.length === 0) { | ||
const params = this.controller.params.filter(param => param.propertyKey === cmd.name); | ||
const gitStyle = params.find(p => p.options.gitStyle); | ||
params.forEach(p => this.param(command, p)); | ||
command.action(options => { | ||
this.parseArgs(options); | ||
if (gitStyle && typeof options === "string") { | ||
command[gitStyle.name] = options; | ||
} | ||
this.parseArgs(command); | ||
this.controller.run([cmd]); | ||
@@ -100,9 +104,14 @@ }); | ||
if (options[name] && typeof options[name] !== "function") { | ||
param.value = options[name]; | ||
return (param.value = options[name]); | ||
} | ||
if (options.parent && | ||
options.parent[name] && | ||
typeof options[name] !== "function") { | ||
return (param.value = options.parent[name]); | ||
} | ||
if (options && typeof options === "string") { | ||
param.value = options; | ||
return (param.value = options); | ||
} | ||
if (options && Array.isArray(options)) { | ||
param.value = options[0]; | ||
return (param.value = options[0]); | ||
} | ||
@@ -109,0 +118,0 @@ } |
{ | ||
"name": "@fivethree/billy-core", | ||
"version": "0.15.1", | ||
"version": "0.15.2", | ||
"description": "cli plugin system core.", | ||
@@ -5,0 +5,0 @@ "repository": { |
59129
1310