mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-12 14:54:57 +00:00
check deps before launching
This commit is contained in:
parent
a622f22dcd
commit
542462faed
21
bin/embark
21
bin/embark
@ -4,11 +4,30 @@ try {
|
|||||||
eval('let __nodeTest = 123;');
|
eval('let __nodeTest = 123;');
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.name === 'SyntaxError') {
|
if (e.name === 'SyntaxError') {
|
||||||
console.error("unsupported version of NodeJS. Make sure you are running nodejs 6.9.5 or above");
|
console.error("unsupported version of NodeJS. Make sure you are running nodejs 8.11.3 or above");
|
||||||
|
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function launchEmbark() {
|
||||||
var Cmd = require('../cmd/cmd');
|
var Cmd = require('../cmd/cmd');
|
||||||
var cli = new Cmd();
|
var cli = new Cmd();
|
||||||
cli.process(process.argv);
|
cli.process(process.argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
require('colors');
|
||||||
|
try {
|
||||||
|
const dappPackage = require(path.join(process.cwd(), 'package.json'));
|
||||||
|
require('check-dependencies')(dappPackage, (state) => {
|
||||||
|
if (state.status) {
|
||||||
|
console.error('\nMissing dependencies. Please run npm install'.red);
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
launchEmbark();
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
launchEmbark();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ if (!process.env.EMBARK_PATH) {
|
|||||||
// as an ejected webpack.config.js), making embark's dependencies trasitive
|
// as an ejected webpack.config.js), making embark's dependencies trasitive
|
||||||
// dependencies of a dapp without the dapp explicitly specifying embark as a
|
// dependencies of a dapp without the dapp explicitly specifying embark as a
|
||||||
// dependency in the dapp's package.json
|
// dependency in the dapp's package.json
|
||||||
process.env.NODE_PATH = utils.joinPath(process.env.EMBARK_PATH, 'node_modules')
|
process.env.NODE_PATH = utils.joinPath(process.env.EMBARK_PATH, 'node_modules') +
|
||||||
+ (process.env.NODE_PATH ? require('path').delimiter : '')
|
(process.env.NODE_PATH ? require('path').delimiter : '') +
|
||||||
+ (process.env.NODE_PATH || '');
|
(process.env.NODE_PATH || '');
|
||||||
|
|
||||||
class Cmd {
|
class Cmd {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -98,13 +98,12 @@ class Cmd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
if (options.simple) {
|
if (options.simple) {
|
||||||
embark.generateTemplate('simple', './', name);
|
embark.generateTemplate('simple', './', name);
|
||||||
} else {
|
} else {
|
||||||
embark.generateTemplate('boilerplate', './', name, options.template);
|
embark.generateTemplate('boilerplate', './', name, options.template);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user