Merge pull request #218 from nogueian/develop
Prevent node exception when running command 'embark blockchain'
This commit is contained in:
commit
9930a9024a
|
@ -23,6 +23,14 @@ Config.prototype.loadConfigFiles = function(options) {
|
|||
if (options.interceptLogs === undefined) {
|
||||
interceptLogs = true;
|
||||
}
|
||||
|
||||
//Check if the config file exists
|
||||
var embarkConfigExists = fs.existsSync(options.embarkConfig);
|
||||
if(!embarkConfigExists){
|
||||
this.logger.error('Cannot find file ' + options.embarkConfig + '. Please ensure you are running this command inside the Dapp folder');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
this.embarkConfig = fs.readJSONSync(options.embarkConfig);
|
||||
this.embarkConfig.plugins = this.embarkConfig.plugins || {};
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ function writeJSONSync() {
|
|||
return fs.writeJSONSync.apply(fs.writeJSONSync, arguments);
|
||||
}
|
||||
|
||||
function existsSync(){
|
||||
return fs.existsSync.apply(fs.existsSync, arguments);
|
||||
}
|
||||
|
||||
// returns embarks root directory
|
||||
function embarkPath(fileOrDir) {
|
||||
return utils.joinPath(__dirname, '/../../', fileOrDir);
|
||||
|
@ -37,6 +41,6 @@ module.exports = {
|
|||
writeFileSync: writeFileSync,
|
||||
readJSONSync: readJSONSync,
|
||||
writeJSONSync: writeJSONSync,
|
||||
existsSync: existsSync,
|
||||
embarkPath: embarkPath
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue