From e044cc0ace9a3b2022248e82f9dbfc2d80678d2d Mon Sep 17 00:00:00 2001 From: Or Sagie Date: Mon, 10 Jun 2019 13:16:27 +0300 Subject: [PATCH] fix: help not loading with hotload after typescriptifying --- src/cli/commands/help.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/help.ts b/src/cli/commands/help.ts index 60aabe7b5f..7accab2952 100644 --- a/src/cli/commands/help.ts +++ b/src/cli/commands/help.ts @@ -1,9 +1,11 @@ +module.exports = help; + import * as fs from 'then-fs'; import * as path from 'path'; import * as Debug from 'debug'; const debug = Debug('snyk'); -export async function help(item: string | boolean) { +async function help(item?: string | boolean) { if (!item || item === true || typeof item !== 'string') { item = 'usage'; } @@ -14,7 +16,7 @@ export async function help(item: string | boolean) { const filename = path.resolve(__dirname, '../../../help', item + '.txt'); try { - await fs.readFile(filename, 'utf8'); + return await fs.readFile(filename, 'utf8'); } catch (error) { debug(error); return `'${item}' help can't be found at location: ${filename}`;