fix(smartcli): tighten command parsing and error handling while updating build and package configuration
This commit is contained in:
@@ -18,7 +18,7 @@ export class Smartcli {
|
||||
*/
|
||||
public parseCompleted = plugins.smartpromise.defer<any>();
|
||||
|
||||
public version: string;
|
||||
public version?: string;
|
||||
|
||||
/**
|
||||
* map of all Trigger/Observable objects to keep track
|
||||
@@ -65,6 +65,9 @@ export class Smartcli {
|
||||
*/
|
||||
public triggerCommand(commandNameArg: string, argvObject: any) {
|
||||
const triggerSubject = this.getCommandSubject(commandNameArg);
|
||||
if (!triggerSubject) {
|
||||
throw new Error(`No smartcli command registered for ${commandNameArg}`);
|
||||
}
|
||||
triggerSubject.next(argvObject);
|
||||
return triggerSubject;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user