1 | #!/usr/bin/env node
|
2 |
|
3 | 'use strict';
|
4 |
|
5 | process.title = 'ionic';
|
6 | process.on('unhandledRejection', function(r) { console.error(r); });
|
7 |
|
8 | var semver = require('semver');
|
9 |
|
10 | if (semver.lt(process.version, 'v6.4.0')) {
|
11 | console.log('ERR: Your Node.js version is ' + process.version + '. Please update to the latest Node 8 LTS.');
|
12 | process.exit(1);
|
13 | }
|
14 |
|
15 | var bootstrap = require('@ionic/cli-utils/bootstrap');
|
16 |
|
17 | bootstrap.detectLocalCLI().then(function(localPath) {
|
18 | var cli = require(localPath);
|
19 | process.env.IONIC_CLI_LOCAL = localPath;
|
20 | process.env.IONIC_CLI_BIN = __filename;
|
21 | cli.run(process.argv, process.env);
|
22 | }, function(err) {
|
23 | var cli = require('../');
|
24 |
|
25 | if (typeof err !== 'string') {
|
26 | throw err;
|
27 | }
|
28 |
|
29 | process.env.IONIC_CLI_LOCAL_ERROR = err;
|
30 | process.env.IONIC_CLI_BIN = __filename;
|
31 | cli.run(process.argv, process.env);
|
32 | });
|