fix(core): update

This commit is contained in:
2021-04-07 20:25:17 +00:00
parent b036e609ce
commit 1d1264c2b3
6 changed files with 10678 additions and 495 deletions

View File

@ -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);
});
}