fix(core): update
This commit is contained in:
@ -17,6 +17,8 @@ export interface ITriggerObservableObject {
|
||||
subject: Subject<any>;
|
||||
}
|
||||
|
||||
const logger = new plugins.smartlog.ConsoleLog();
|
||||
|
||||
/**
|
||||
* class to create a new instance of Smartcli. Handles parsing of command line arguments.
|
||||
*/
|
||||
@ -80,7 +82,7 @@ export class Smartcli {
|
||||
if (!this.getTriggerSubject(triggerNameArg)) {
|
||||
this.allTriggerObservablesMap.add({
|
||||
triggerName: triggerNameArg,
|
||||
subject: triggerSubject
|
||||
subject: triggerSubject,
|
||||
});
|
||||
} else {
|
||||
throw new Error(`you can't add a trigger twice`);
|
||||
@ -100,7 +102,7 @@ export class Smartcli {
|
||||
|
||||
getTriggerSubject(triggerName: string) {
|
||||
const triggerObservableObject = this.allTriggerObservablesMap.find(
|
||||
triggerObservableObjectArg => {
|
||||
(triggerObservableObjectArg) => {
|
||||
return triggerObservableObjectArg.triggerName === triggerName;
|
||||
}
|
||||
);
|
||||
@ -115,8 +117,8 @@ export class Smartcli {
|
||||
* allows to specify help text to be printed above the rest of the help text
|
||||
*/
|
||||
addHelp(optionsArg: { helpText: string }) {
|
||||
this.addCommand('help').subscribe(argvArg => {
|
||||
plugins.smartlog.defaultLogger.log('info', optionsArg.helpText);
|
||||
this.addCommand('help').subscribe((argvArg) => {
|
||||
logger.log('info', optionsArg.helpText);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user