mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-15 19:49:57 -06:00
* ci: use Node 8.2.1 to build binary on Windows CI #1390 * use Node 8.2.1 on Mac buildkite * add comment * source bashrc * print home folder * do not source bashrc * install nvm using curl * back to nvm using bash_profile * hmm, maybe it is using different shell * hmm, login into bash * remove nvm commands * chore: add script to check Node version against .node-version
21 lines
751 B
JavaScript
21 lines
751 B
JavaScript
// TODO make this check a 3rd party little tool
|
|
|
|
// we want to ensure we are building using the same major version
|
|
// as the one specified in ../.node-version file
|
|
const read = require('fs').readFileSync
|
|
const join = require('path').join
|
|
|
|
const nodeVersionNeededString = read(join(__dirname, '..', '.node-version'), 'utf8')
|
|
const nodeVersionNeeded = nodeVersionNeededString.split('.')
|
|
|
|
const nodeVersion = process.versions.node.split('.')
|
|
|
|
// check just major version for now
|
|
if (nodeVersionNeeded[0] !== nodeVersion[0]) {
|
|
/* eslint-disable no-console */
|
|
console.error('🛑 .node-version specified %s', nodeVersionNeededString)
|
|
console.error('but current Node is %s', process.versions.node)
|
|
/* eslint-enable no-console */
|
|
process.exit(1)
|
|
}
|