forked from trufflesuite/truffle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·44 lines (40 loc) · 1.59 KB
/
cli.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
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
require("babel-register");
require("babel-polyfill");
var Command = require("./lib/command");
var Tasks = require("./lib/tasks");
var TaskError = require("./lib/errors/taskerror");
var ExtendableError = require("./lib/errors/extendableerror");
var command = new Command(Tasks);
command.run(process.argv.slice(2), function(err) {
if (err) {
if (err instanceof TaskError) {
command.run("list", function() {});
} else {
if (err instanceof ExtendableError) {
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);
}
});
// // Check to see if we're working on a dapp meant for 0.2.x or older
// if (fs.existsSync(path.join(working_dir, "config", "app.json"))) {
// console.log("Your dapp is meant for an older version of Truffle. Don't worry, there are two solutions!")
// console.log("");
// console.log("1) Upgrade your dapp using the followng instructions (it's easy):");
// console.log(" https://github.com/ConsenSys/truffle/wiki/Migrating-from-v0.2.x-to-v0.3.0");
// console.log("");
// console.log(" ( OR )")
// console.log("");
// console.log("2) Downgrade to Truffle 0.2.x");
// console.log("");
// console.log("Cheers! And file an issue if you run into trouble! https://github.com/ConsenSys/truffle/issues")
// process.exit();
// }