mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-22 06:59:30 -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
This commit is contained in:
20
scripts/check-node-version.js
Normal file
20
scripts/check-node-version.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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)
|
||||
}
|
||||
Reference in New Issue
Block a user