-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Stats wasn't working entirely like it should have
- Loading branch information
1 parent
1c59113
commit ee5869d
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Command, MockingConfig } from './index'; | ||
import { traceFunction } from 'helpers/util'; | ||
|
||
@traceFunction() | ||
export default class Stats extends Command { | ||
constructor(config?: MockingConfig) { | ||
super('stats', config); | ||
} | ||
|
||
public async run() { | ||
await this.check(); | ||
|
||
if (this.flags.includes('--all')) { | ||
return this.spawn('docker', ['stats', '--all']); | ||
} | ||
|
||
if ( | ||
this.allowedFlags.includes('prompt') && | ||
(this.flags.includes('-p') || this.flags.includes('--prompt')) | ||
) { | ||
await this.determine(); | ||
// Filter out the prompt flag for further execution | ||
this.flags = this.flags.filter( | ||
flag => !['--prompt', '-p'].includes(flag), | ||
); | ||
} | ||
|
||
return this.execute(); | ||
} | ||
} |