Files
cypress/scripts/utils.js
Gleb Bahmutov 4672b569f1 Upload tar and zip (#536)
* run linter an all

* add NPM package CI job

* more steps for NPM package

* start upload NPM package

* more work on NPM package upload

* testing upload

* move purge cache to utils

* add unique binary build and upload from CI

* pass saved urls to test-binary job

* allow CYPRESS_BINARY_VERSION to be an url right away

* put uploaded urls into /tmp folder

* use explicit json filenames

* paths instead of path

* testing cypress npm and binary

* use NPM folder beta to store temp binary and package

* refactor utils

* set env vars and trigger other test projects

* only test NPM and binary on develop branch

* enable all jobs again
2017-10-01 17:01:19 -04:00

33 lines
846 B
JavaScript

const minimist = require('minimist')
const la = require('lazy-ass')
const is = require('check-more-types')
const path = require('path')
/* eslint-disable no-console */
function getNameAndBinary (args = process.argv) {
const options = minimist(args)
la(is.unemptyString(options.npm),
'missing --npm option with package url', options)
la(is.unemptyString(options.binary),
'missing --binary option with binary url', options)
console.log('loading NPM url from', options.npm)
const npmUrl = require(path.resolve(options.npm)).url
la(is.url(npmUrl), 'not an url', npmUrl)
console.log('loading binary url from', options.binary)
const binaryUrl = require(path.resolve(options.binary)).url
la(is.url(binaryUrl), 'not an url', binaryUrl)
return {
npmUrl,
binaryUrl,
}
}
module.exports = {
getNameAndBinary,
}