UNPKG

835 BPlain TextView Raw
1#!/usr/bin/env node
2
3'use strict';
4
5process.title = 'ionic';
6process.on('unhandledRejection', function(r) { console.error(r); });
7
8var semver = require('semver');
9
10if (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
15var bootstrap = require('@ionic/cli-utils/bootstrap');
16
17bootstrap.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});