forked from Consensys/quorum-dev-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·22 lines (21 loc) · 788 Bytes
/
Copy pathindex.js
File metadata and controls
executable file
·22 lines (21 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env node
const main = require("./build").main;
if (require.main === module) {
// note: main returns a Promise<void>, but we don't need to do anything
// special with it, so we use the void operator to indicate to eslint that
// we left this dangling intentionally...
try {
void main();
} catch (err) {
if (err && err.stack && process.argv.length >= 3 && process.argv[2] === "--stackTraceOnError") {
console.error(`Fatal error: ${err.stack}`);
} else if (err && err.message) {
console.error(`Fatal error: ${err.message}`);
} else if (err) {
console.error(`Fatal error: ${err}`);
} else {
console.error(`Fatal error: unknown`);
}
process.exit(1);
}
}