From 41f42c2f9d3e0a8e457197aecc68b57bbc7410ee Mon Sep 17 00:00:00 2001 From: Bsian Date: Wed, 1 Jan 2020 21:37:20 +0000 Subject: [PATCH] same as prev --- src/class/Util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index e8580de..a24364d 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -29,11 +29,11 @@ export default class Util { * @param command The command to execute * @param options childProcess.ExecOptions, the env option is automatically set if not provided. */ - public async exec(command: string, options?: childProcess.ExecOptions): Promise { + public async exec(command: string, options: childProcess.ExecOptions = {}): Promise { const ex = promisify(childProcess.exec); let result: string; try { - if (!options || (!options.env)) options.env = { HOME: '/root' }; + if (!options.env) options.env = { HOME: '/root' }; const res = await ex(command, options); result = res.stderr || res.stdout; } catch (err) {