mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-25 10:30:39 -06:00
Fix cypress cache subcommands (#6348)
This commit is contained in:
@@ -131,6 +131,8 @@ exports['cli unknown option shows help for cache command - unknown sub-command f
|
||||
|
||||
stdout:
|
||||
-------
|
||||
error: unknown command: cache foo
|
||||
|
||||
Usage: cypress cache [command]
|
||||
|
||||
Manages the Cypress binary cache
|
||||
|
||||
@@ -283,17 +283,19 @@ module.exports = {
|
||||
.option('list', text('cacheList'))
|
||||
.option('path', text('cachePath'))
|
||||
.option('clear', text('cacheClear'))
|
||||
.action(function (opts) {
|
||||
if (!_.isString(opts)) {
|
||||
.action(function (opts, args) {
|
||||
if (!args || !args.length) {
|
||||
this.outputHelp()
|
||||
util.exit(1)
|
||||
}
|
||||
|
||||
if (opts.command || !_.includes(['list', 'path', 'clear'], opts)) {
|
||||
unknownOption.call(this, `cache ${opts}`, 'command')
|
||||
const [command] = args
|
||||
|
||||
if (!_.includes(['list', 'path', 'clear'], command)) {
|
||||
unknownOption.call(this, `cache ${command}`, 'command')
|
||||
}
|
||||
|
||||
cache[opts]()
|
||||
cache[command]()
|
||||
})
|
||||
|
||||
debug('cli starts with arguments %j', args)
|
||||
|
||||
Reference in New Issue
Block a user