embark-area-51/bin/embark

36 lines
842 B
JavaScript
Executable File

#!/usr/bin/env node
try {
eval('let __nodeTest = 123;');
} catch(e) {
if (e.name === 'SyntaxError') {
console.error("unsupported version of NodeJS. Make sure you are running nodejs 8.11.3 or above");
process.exit();
}
}
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'));
require(path.join(process.cwd(), 'embark.json')); // Make sure we are in a Dapp
require('check-dependencies')(dappPackage, (state) => {
if (state.status) {
require('colors');
console.error('\nMissing dependencies. Please run npm install'.red);
process.exit();
}
launchEmbark();
});
} catch (_e) {
// We are not in a Dapp
launchEmbark();
}