1 | #!/usr/bin/env node
|
2 |
|
3 | process.on('unhandledRejection', on_unhandled_error);
|
4 | process.on('uncaughtException', on_unhandled_error);
|
5 |
|
6 | var os = require('os'),
|
7 | path = require('path');
|
8 |
|
9 | process.env.BABEL_CACHE_PATH = path.join(os.tmpdir(), '/ryuu.json');
|
10 |
|
11 | // enable awesomeness
|
12 | require("babel/register")({
|
13 | stage: 0,
|
14 | sourceMap: 'inline',
|
15 | only: ['domo.js', 'server.js', 'commands/**.js', 'util/**.js', 'polyfills/**.js']
|
16 | });
|
17 |
|
18 | var already_warned = false;
|
19 | function on_unhandled_error(err) {
|
20 | if (already_warned) {
|
21 | return;
|
22 | }
|
23 |
|
24 | already_warned = true;
|
25 |
|
26 | console.log('');
|
27 | console.error('[ERROR] The domo cli tool has experienced an error. As it is');
|
28 | console.error('[ERROR] possible this bug has already been fixed, please try updating');
|
29 | console.error('[ERROR] using `npm install -g ryuu` and run this command again. If this');
|
30 | console.error('[ERROR] does not fix the issue, please contact your MajorDomo.');
|
31 | console.error('[ERROR] error message: %s', err.message);
|
32 | }
|
33 |
|
34 | // enable source maps
|
35 | require('source-map-support').install();
|
36 |
|
37 | require('./domo');
|