UNPKG

748 BJavaScriptView Raw
1#!/usr/bin/env node
2
3try {
4 var REQUIRED_NODE_VERSION = '10.10';
5 var version = process.version;
6 if( version.indexOf('v') === 0 ) version = version.substr(1);
7 version = version.split('.');
8
9 var majorVersion = version[0];
10 majorVersion = parseInt(majorVersion);
11
12 var minorVersion = version[1];
13 minorVersion = parseInt(minorVersion);
14
15 if( majorVersion < 10 || ( majorVersion === 10 && minorVersion < 10 ) )
16 return console.error(`Error: athom-cli requires Node.js v${REQUIRED_NODE_VERSION} or higher to run. Please upgrade your Node.js version and try again.`);
17
18} catch( err ) {
19 console.error(`Failed to determine Node.js version, please make sure you\'re using version ${REQUIRED_NODE_VERSION} or higher.`);
20}
21
22require('./athom-cli.js');
\No newline at end of file