feat: Print folder sizes with cypress cache list command. (#8590)

This commit is contained in:
Kukhyeon Heo
2020-10-06 00:31:59 +09:00
committed by GitHub
parent 4d76049d2c
commit aa4772c4cf
7 changed files with 147 additions and 6 deletions
+8
View File
@@ -102,6 +102,7 @@ const descriptions = {
cacheClear: 'delete all cached binaries',
cacheList: 'list cached binary versions',
cachePath: 'print the path to the binary cache',
cacheSize: 'Used with the list command to show the sizes of the cached folders',
ciBuildId: 'the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers',
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.',
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.',
@@ -386,6 +387,7 @@ module.exports = {
.option('list', text('cacheList'))
.option('path', text('cachePath'))
.option('clear', text('cacheClear'))
.option('--size', text('cacheSize'))
.action(function (opts, args) {
if (!args || !args.length) {
this.outputHelp()
@@ -398,6 +400,12 @@ module.exports = {
unknownOption.call(this, `cache ${command}`, 'command')
}
if (command === 'list') {
cache.list(opts.size)
return
}
cache[command]()
})