From 61a1d84042a2fa159779175666b66f7510bd0e5e Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 9 Aug 2021 14:16:58 -0600 Subject: [PATCH 1/2] fix: include SfdxError props on SfdxExecCmdResult --- src/execCmd.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/execCmd.ts b/src/execCmd.ts index 27630a2b..079d521b 100644 --- a/src/execCmd.ts +++ b/src/execCmd.ts @@ -7,7 +7,7 @@ import { join as pathJoin, resolve as pathResolve } from 'path'; import { inspect } from 'util'; -import { fs } from '@salesforce/core'; +import { fs, SfdxError } from '@salesforce/core'; import { Duration, env, parseJson } from '@salesforce/kit'; import { AnyJson, isNumber } from '@salesforce/ts-types'; import Debug from 'debug'; @@ -61,7 +61,7 @@ export interface SfdxExecCmdResult extends ExecCmdResult { /** * Command output parsed as JSON, if `--json` param present. */ - jsonOutput?: { status: number; result: T }; + jsonOutput?: { status: number; result: T } & Partial; } export interface SfExecCmdResult extends ExecCmdResult { From 6e072e5e86c58be4afb995d946ad7e8541558a3f Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 9 Aug 2021 14:44:52 -0600 Subject: [PATCH 2/2] fix: improve solution for including SfdxError props --- src/execCmd.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/execCmd.ts b/src/execCmd.ts index 079d521b..ef70c6d3 100644 --- a/src/execCmd.ts +++ b/src/execCmd.ts @@ -57,11 +57,14 @@ export interface ExecCmdResult { execCmdDuration: Duration; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type ExcludeMethods = Pick any ? never : K }[keyof T]>>; + export interface SfdxExecCmdResult extends ExecCmdResult { /** * Command output parsed as JSON, if `--json` param present. */ - jsonOutput?: { status: number; result: T } & Partial; + jsonOutput?: { status: number; result: T } & Partial>; } export interface SfExecCmdResult extends ExecCmdResult {