Files
cypress/cli/index.js
Gleb Bahmutov 9f082d97ca Catch env variable with reserved name CYPRESS_ENV 1621 (#1626)
* server: check CYPRESS_ENV variable when merging configs

* catch invalid CYPRESS_ENV value in CLI, close #1621

* linting

* sanitize platform in test snapshot

* linting

* update error message text

* add missing comma

* fix finally merge in JS code

* pass CLI linter

* fix log reference, should be debug

* use correct sinon reference

* update message, show first part in red

* update error message text
2019-09-23 11:59:49 -04:00

29 lines
729 B
JavaScript

const minimist = require('minimist')
const debug = require('debug')('cypress:cli')
const args = minimist(process.argv.slice(2))
const util = require('./lib/util')
// we're being used from the command line
switch (args.exec) {
case 'install':
debug('installing Cypress from NPM')
require('./lib/tasks/install')
.start({ force: args.force })
.catch(util.logErrorExit1)
break
case 'verify':
// for simple testing in the monorepo
debug('verifying Cypress')
require('./lib/tasks/verify')
.start({ force: true }) // always force verification
.catch(util.logErrorExit1)
break
default:
debug('exporting Cypress module interface')
module.exports = require('./lib/cypress')
}