mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-10 00:30:37 -06:00
* trigger/bump other projects serially * bring version of bumper that suppors appVeyor variables * add cypress-tiny-project test
40 lines
951 B
JavaScript
40 lines
951 B
JavaScript
const minimist = require('minimist')
|
|
const la = require('lazy-ass')
|
|
const is = require('check-more-types')
|
|
const path = require('path')
|
|
const fs = require('fs')
|
|
|
|
/* eslint-disable no-console */
|
|
|
|
function getNameAndBinary (args = process.argv) {
|
|
const options = minimist(args)
|
|
|
|
la(is.unemptyString(options.npm),
|
|
'missing --npm option', options)
|
|
la(is.unemptyString(options.binary),
|
|
'missing --binary option', options)
|
|
|
|
let npm = options.npm
|
|
if (fs.existsSync(options.npm)) {
|
|
console.log('loading NPM url from', options.npm)
|
|
npm = require(path.resolve(options.npm)).url
|
|
la(is.url(npm), 'not an url', npm)
|
|
}
|
|
|
|
let binary = options.binary
|
|
if (fs.existsSync(options.binary)) {
|
|
console.log('loading binary url from', options.binary)
|
|
binary = require(path.resolve(options.binary)).url
|
|
la(is.url(binary), 'not an url', binary)
|
|
}
|
|
|
|
return {
|
|
npm,
|
|
binary,
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
getNameAndBinary,
|
|
}
|