From 45bf11ff2b39842cc685da8670f09aa9870f1723 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 28 May 2018 11:55:16 -0400 Subject: [PATCH] conflict in en.json --- lib/cmds/blockchain/blockchain.js | 16 +++++++++++++++- lib/cmds/blockchain/geth_commands.js | 12 ++++++------ lib/i18n/locales/en.json | 4 ++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 26af6622..e4da507d 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -55,6 +55,20 @@ var Blockchain = function(options) { this.config.datadir = fs.embarkPath(".embark/development/datadir"); } + const spaceMessage = 'The path for %s in blockchain config contains spaces, please remove them'; + if (this.config.datadir.indexOf(' ') > 0) { + console.error(__(spaceMessage, 'datadir')); + process.exit(); + } + if (this.config.account.password.indexOf(' ') > 0) { + console.error(__(spaceMessage, 'account.password')); + process.exit(); + } + if (this.config.genesisBlock.indexOf(' ') > 0) { + console.error(__(spaceMessage, 'genesisBlock')); + process.exit(); + } + this.client = new options.client({config: this.config, env: this.env, isDev: this.isDev}); }; @@ -154,7 +168,7 @@ Blockchain.prototype.checkPathLength = function() { }; Blockchain.prototype.isClientInstalled = function(callback) { - let versionCmd = this.client.determineVersion(); + let versionCmd = this.client.determineVersionCommand(); this.runCommand(versionCmd, {}, (err, stdout, stderr) => { if (err || stderr || !stdout || stdout.indexOf("not found") >= 0) { return callback('Geth not found'); diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js index 0c9924ff..874e004e 100644 --- a/lib/cmds/blockchain/geth_commands.js +++ b/lib/cmds/blockchain/geth_commands.js @@ -17,7 +17,7 @@ class GethCommands { cmd.push(this.determineNetworkType(config)); if (config.datadir) { - cmd.push("--datadir=" + config.datadir); + cmd.push(`--datadir=${config.datadir}`); } if (config.light) { @@ -29,7 +29,7 @@ class GethCommands { } if (config.account && config.account.password) { - cmd.push("--password=" + config.account.password); + cmd.push(`--password=${config.account.password}`); } if (Number.isInteger(config.verbosity) && config.verbosity >=0 && config.verbosity <= 5) { @@ -39,7 +39,7 @@ class GethCommands { return cmd; } - determineVersion() { + determineVersionCommand() { return this.geth_bin + " version"; } @@ -60,18 +60,18 @@ class GethCommands { let cmd = this.geth_bin + " " + this.commonOptions().join(' '); if (config.genesisBlock) { - cmd += "init \"" + config.genesisBlock + "\" "; + cmd += " init \"" + config.genesisBlock + "\" "; } return cmd; } newAccountCommand() { - return this.geth_bin + " " + this.commonOptions().join(' ') + "account new "; + return this.geth_bin + " " + this.commonOptions().join(' ') + " account new "; } listAccountsCommand() { - return this.geth_bin + " " + this.commonOptions().join(' ') + "account list "; + return this.geth_bin + " " + this.commonOptions().join(' ') + " account list "; } determineRpcOptions(config) { diff --git a/lib/i18n/locales/en.json b/lib/i18n/locales/en.json index 16d2aa46..8709bc97 100644 --- a/lib/i18n/locales/en.json +++ b/lib/i18n/locales/en.json @@ -139,6 +139,10 @@ "Storage process for ipfs ended before the end of this process. Code: 0": "Storage process for ipfs ended before the end of this process. Code: 0", "successfully uploaded to swarm": "successfully uploaded to swarm", "ipfs process started": "ipfs process started", + "no accounts found": "no accounts found", + "initializing genesis block": "initializing genesis block", + "The path for %s in blockchain config contains spaces, please remove them": "The path for %s in blockchain config contains spaces, please remove them", + "Blockchain process ended before the end of this process. Code: %s": "Blockchain process ended before the end of this process. Code: %s", "WARNING! DApp path length is too long: ": "WARNING! DApp path length is too long: ", "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.", "Installing packages...": "Installing packages...",