-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
executable file
·35 lines (31 loc) · 1.03 KB
/
index.js
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
#!/usr/bin/env node
require('source-map-support/register')
var Migrate = require('./lib/commands/migrate');
var TaskError = require("truffle-core/lib/errors/taskerror");
var TruffleError = require("truffle-error");
var Command = require("truffle-core/lib/command");
var options = {
logger: console
};
var command = new Command(require("./lib/commands"));
command.run(['migrate'].concat(process.argv.slice(1)), options, function (err) {
if (err) {
if (err instanceof TaskError) {
command.args
.usage('Usage: truffle-migrate-off-chain [options]')
.epilog("See more at https://github.com/asselstine/truffle-migrate-off-chain")
.showHelp();
} else {
if (err instanceof TruffleError) {
console.log(err.message);
} else if (typeof err == "number") {
// If a number is returned, exit with that number.
process.exit(err);
} else {
// Bubble up all other unexpected errors.
console.log(err.stack || err.toString());
}
}
process.exit(1);
}
});