mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-04 22:30:00 -06:00
29 lines
718 B
JavaScript
29 lines
718 B
JavaScript
const minimist = require('minimist')
|
|
const debug = require('debug')('cypress:cli')
|
|
const args = minimist(process.argv.slice(2))
|
|
|
|
const reportError = (err) => {
|
|
console.error(err) // eslint-disable-line no-console
|
|
process.exit(1)
|
|
}
|
|
|
|
// we're being used from the command line
|
|
switch (args.exec) {
|
|
case 'install':
|
|
debug('installing Cypress from NPM')
|
|
require('./lib/download')
|
|
.install()
|
|
.catch(reportError)
|
|
break
|
|
case 'verify':
|
|
// for simple testing in the monorepo
|
|
debug('verifying Cypress')
|
|
require('./lib/download/utils')
|
|
.verify()
|
|
.catch(reportError)
|
|
break
|
|
default:
|
|
// export our node module interface
|
|
module.exports = require('./lib/cypress')
|
|
}
|