-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
executable file
·41 lines (36 loc) · 765 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
/**
* local-wpcli
*
* Application entry file.
*
* @since 0.1.0
*/
'use strict';
const chalk = require('chalk');
const nodeVersion = process.versions.node;
const semVer = nodeVersion.split('.');
const major = semVer[0];
// If below Node 8.
if (major < 8) {
console.error( // eslint-disable-line no-console
chalk.red(
`⚠️ You are running Node ${nodeVersion}
Local-WPCLI requires Node 8 or higher.
Kindly, update your version of Node.`
)
);
process.exit(1);
}
// Crash the script on unhandled rejections.
process.on('unhandledRejection', (reason) => {
console.log( // eslint-disable-line no-console
'Unhandled Rejection due to reason:',
reason
);
});
/**
* Run the CLI.
*/
const run = require('./app/run');
run();