Skip to content

Commit

Permalink
fix: fix #36 this.getLogger is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jblew committed Jan 31, 2019
1 parent 5469ebf commit 8e7a672
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export class Context {
this.stdout = process.stdout;
this.stdin = process.stdin;
this.stderr = process.stderr;
this.log = console.log;
this.error = console.error;
this.debug = Log.log().debug;
this.info = Log.log().info;
this.log = (msg: string) => console.log(msg);
this.error = (msg?: string, error?: any) => console.error(msg, error);
this.debug = (msg: string) => Log.log().debug(msg);
this.info = (msg: string) => Log.log().info(msg);
this.exception = (exception: Error, level?: string) => Log.log().exception(level || Log.level.error, exception);
}
}
}
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class App {

private async loadConfig(loadFromFile: boolean): Promise<ConfigLoadedFromFile> {
if (loadFromFile) return ConfigLoader.loadConfig(this.commander);
else return Promise.resolve({ ...StaticConfig.DEFAULT_CONFIG, configFilePath: process.cwd() });
else return { ...StaticConfig.DEFAULT_CONFIG, configFilePath: process.cwd() };
}

private runCb(doneCallback: (error: any, result?: string) => void) {
Expand All @@ -184,7 +184,7 @@ export class App {
this.commandExecutionBegun = true;
(async () => {
try {
this.initAction();
await this.initAction();
const result: string = await action();
this.doneCallback(undefined, result);
} catch (error) {
Expand Down

0 comments on commit 8e7a672

Please sign in to comment.