mirror of https://github.com/embarklabs/embark.git
fix: swarm command registers and warns when swarm is disabled
This commit is contained in:
parent
e36ea5d24d
commit
afe2512eff
|
@ -26,8 +26,15 @@ class Swarm {
|
||||||
if(this.isSwarmEnabledInTheConfig() && cantDetermineUrl){
|
if(this.isSwarmEnabledInTheConfig() && cantDetermineUrl){
|
||||||
console.warn('\n===== Swarm module will not be loaded =====');
|
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`);
|
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`);
|
||||||
|
} 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();
|
||||||
}
|
}
|
||||||
if (!this.isSwarmEnabledInTheConfig() || cantDetermineUrl) {
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue