Skip to content

Commit

Permalink
fix: flag setter order (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jul 21, 2022
1 parent 18e77f7 commit a02f86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command.ts
Expand Up @@ -136,7 +136,7 @@ export default abstract class Command {

static set globalFlags(flags: Interfaces.FlagInput<any>) {
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 */
Expand All @@ -147,7 +147,7 @@ export default abstract class Command {
}

static set flags(flags: Interfaces.FlagInput<any>) {
this._flags = Object.assign({}, this.globalFlags, flags)
this._flags = Object.assign({}, this._flags ?? {}, this.globalFlags, flags)
}

id: string | undefined
Expand Down

0 comments on commit a02f86c

Please sign in to comment.