From a02f86cb1094a86ba0cd8689fd82908ff3d46386 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 21 Jul 2022 10:00:17 -0700 Subject: [PATCH] fix: flag setter order (#450) --- src/command.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command.ts b/src/command.ts index 1d49110c9..45ec4fd38 100644 --- a/src/command.ts +++ b/src/command.ts @@ -136,7 +136,7 @@ export default abstract class Command { static set globalFlags(flags: Interfaces.FlagInput) { this._globalFlags = Object.assign({}, this.globalFlags, flags) - this.flags = this.globalFlags + this.flags = {} // force the flags setter to run } /** A hash of flags for the command */ @@ -147,7 +147,7 @@ export default abstract class Command { } static set flags(flags: Interfaces.FlagInput) { - this._flags = Object.assign({}, this.globalFlags, flags) + this._flags = Object.assign({}, this._flags ?? {}, this.globalFlags, flags) } id: string | undefined