2015-05-24 13:03:43 +00:00
|
|
|
#!/usr/bin/env node
|
2018-01-12 20:36:10 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
eval('let __nodeTest = 123;');
|
|
|
|
} catch(e) {
|
|
|
|
if (e.name === 'SyntaxError') {
|
2018-09-07 16:37:18 +00:00
|
|
|
console.error("unsupported version of NodeJS. Make sure you are running nodejs 8.11.3 or above");
|
|
|
|
|
2018-01-12 20:36:10 +00:00
|
|
|
process.exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-07 16:37:18 +00:00
|
|
|
function launchEmbark() {
|
|
|
|
var Cmd = require('../cmd/cmd');
|
|
|
|
var cli = new Cmd();
|
|
|
|
cli.process(process.argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
const path = require('path');
|
|
|
|
try {
|
|
|
|
const dappPackage = require(path.join(process.cwd(), 'package.json'));
|
2018-09-07 16:40:25 +00:00
|
|
|
require(path.join(process.cwd(), 'embark.json')); // Make sure we are in a Dapp
|
2018-09-07 16:37:18 +00:00
|
|
|
require('check-dependencies')(dappPackage, (state) => {
|
|
|
|
if (state.status) {
|
2018-09-07 16:40:25 +00:00
|
|
|
require('colors');
|
2018-09-07 16:37:18 +00:00
|
|
|
console.error('\nMissing dependencies. Please run npm install'.red);
|
|
|
|
process.exit();
|
|
|
|
}
|
|
|
|
launchEmbark();
|
|
|
|
});
|
2018-09-07 16:40:25 +00:00
|
|
|
} catch (_e) {
|
|
|
|
// We are not in a Dapp
|
2018-09-07 16:37:18 +00:00
|
|
|
launchEmbark();
|
|
|
|
}
|
|
|
|
|