Skip to content

Commit

Permalink
fix: swarm command registers and warns when swarm is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Medeiros authored and iurimatias committed Jan 25, 2019
1 parent e36ea5d commit afe2512
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/modules/swarm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ class Swarm {
if(this.isSwarmEnabledInTheConfig() && cantDetermineUrl){
console.warn('\n===== Swarm module will not be loaded =====');
console.warn(`Swarm is enabled in the config, however the config is not setup to provide a URL for swarm and therefore the Swarm module will not be loaded. Please either change the ${'config/storage > upload'.bold} setting to Swarm or add the Swarm config to the ${'config/storage > dappConnection'.bold} array. Please see ${'https://embark.status.im/docs/storage_configuration.html'.underline} for more information.\n`);
}
if (!this.isSwarmEnabledInTheConfig() || cantDetermineUrl) {
} else {
this.embark.registerConsoleCommand({
matches: cmd => cmd === "swarm" || cmd.indexOf('swarm ') === 0,
process: (_cmd, cb) => {
console.warn(__(`Swarm is disabled or not configured. Please see %s for more information.`, 'https://embark.status.im/docs/storage_configuration.html'.underline));
cb();
}
});

return;
}

Expand Down

0 comments on commit afe2512

Please sign in to comment.