insomnia/scripts/check-version.js
2020-08-13 09:12:31 +12:00

18 lines
483 B
JavaScript

const fs = require('fs');
const foundNodeVersion = process.versions.node;
const expectedNodeVersion = fs
.readFileSync('.nvmrc')
.toString()
.trim();
if (foundNodeVersion !== expectedNodeVersion) {
console.log(`Current node version: ${foundNodeVersion}`);
console.log(`Expected node version: ${expectedNodeVersion}`);
console.log(
`Remember to 'npm run clean && npm run bootstrap' after installing the expected version.`,
);
console.log();
process.exit(1);
}