From 17760f41c4ebd0ffce41a709edb119e1fc43eb52 Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 15 Oct 2019 23:44:46 +0100 Subject: [PATCH] Linting --- src/Util.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Util.ts b/src/Util.ts index f1e9ece..62b90d0 100644 --- a/src/Util.ts +++ b/src/Util.ts @@ -14,10 +14,10 @@ export default class Util { public async exec(command: string): Promise { const ex = promisify(childProcess.exec); let result: string; + // eslint-disable-next-line no-useless-catch try { const res = await ex(command); - if (res.stderr) result = res.stderr; - else result = res.stdout; + result = res.stderr || res.stdout; } catch (err) { throw err; } @@ -32,10 +32,11 @@ export default class Util { public resolveCommand(command: string): Command { if (this.client.commands.has(command)) return this.client.commands.get(command); for (const cmd of this.client.commands.values()) { - if (!cmd.aliases) continue; + if (!cmd.aliases) continue;// eslint-disable-line no-continue for (const alias of cmd.aliases) { if (command === alias.toLowerCase()) return cmd; } } + return undefined; } }