chore: install specific Node version on Mac before building binary (#8242)

This commit is contained in:
Gleb Bahmutov
2020-08-11 13:14:33 -04:00
committed by GitHub
parent 21748faddc
commit dc523eb390
6 changed files with 184 additions and 99 deletions

View File

@@ -3,23 +3,10 @@ const assert = require('assert')
// TODO make this check a 3rd party little tool
// on CircleCI Mac machine, we need to use on of the laer executors
// that already has Node 10 / 11
const isMac = () => {
return os.platform() === 'darwin'
}
const isWindows = () => {
return os.platform() === 'win32'
}
if (isMac() && process.env.CIRCLECI) {
// eslint-disable-next-line no-console
console.log('Skipping Node version check on CircleCI Mac')
return
}
// if we're windows + in appveyor...
if (isWindows() && process.env.APPVEYOR) {
// check to ensure that the cpuArch + nodeArch are in sync

11
scripts/load-nvm.sh Executable file
View File

@@ -0,0 +1,11 @@
# loads previously installed NVM
# USE:
# - run:
# name: check Node version
# command: |
# . ./scripts/load-nvm.sh
# yarn check-node-version
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
export NODE_VERSION=$(cat .node-version)