-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (26 loc) · 973 Bytes
/
index.js
File metadata and controls
36 lines (26 loc) · 973 Bytes
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
// force tty
process.stdout.isTTY = true;
// modules > native
var p = require('path');
// set up some globals
global.ENV = global.ENV || process.env.NODE_ENV || 'development';
global.PWD = global.PWD || process.env.NODE_PWD || process.cwd();
var symlinked = __dirname.indexOf(PWD) < 0;
if(symlinked) {
module.paths.unshift(p.join(PWD, 'node_modules'));
}
var appModulePath = require( 'app-module-path');
if(symlinked)
// only needed for symlinked modules. such as epiphany itself or hats
appModulePath.addPath(p.join(PWD, 'node_modules'));
appModulePath.addPath(p.join(PWD, 'modules'));
var colorizeStack = require('./util/colorize-stack');
// make error output stack pretty
process.on('uncaughtException', function (err) {
// TODO Node natively seems to get the line and outputs it before the stack
console.error(err.name);
console.error(err.message);
console.error(colorizeStack(err.stack));
process.exit(1);
});
module.exports = require('./epiphany');