diff --git a/packages/dashmate/src/commands/setup.js b/packages/dashmate/src/commands/setup.js index f6674a7ef34..05303cf85ec 100644 --- a/packages/dashmate/src/commands/setup.js +++ b/packages/dashmate/src/commands/setup.js @@ -69,32 +69,30 @@ class SetupCommand extends BaseCommand { initial: PRESET_MAINNET, }, ]); + } - let isAlreadyConfigured; - if (ctx.preset === PRESET_LOCAL) { - isAlreadyConfigured = configFile.isGroupExists(ctx.preset); - } else { - const systemConfig = new Config(ctx.preset, systemConfigs[ctx.preset]); + let isAlreadyConfigured; + if (ctx.preset === PRESET_LOCAL) { + isAlreadyConfigured = configFile.isGroupExists(ctx.preset); + } else { + const systemConfig = new Config(ctx.preset, systemConfigs[ctx.preset]); - isAlreadyConfigured = !configFile.getConfig(ctx.preset).isEqual(systemConfig); - } + isAlreadyConfigured = !configFile.getConfig(ctx.preset).isEqual(systemConfig); + } - if (isAlreadyConfigured) { - // eslint-disable-next-line no-param-reassign - task.output = chalk`Preset {bold ${ctx.preset}} already configured. + if (isAlreadyConfigured) { + // eslint-disable-next-line no-param-reassign + task.output = chalk`Preset {bold ${ctx.preset}} already configured. To set up a node with this preset from scratch use {bold.cyanBright dashmate reset --config ${ctx.preset} --hard}. Previous data and configuration for this preset will be lost. If you want to keep the existing data and configuration, please use the {bold.cyanBright dashmate config create} command to create a new configuration for this preset.`; - throw new Error(`Preset ${ctx.preset} already configured`); - } else { - // eslint-disable-next-line no-param-reassign - - // eslint-disable-next-line no-param-reassign - task.output = ctx.preset; - } + throw new Error(`Preset ${ctx.preset} already configured`); + } else { + // eslint-disable-next-line no-param-reassign + task.output = ctx.preset; } }, options: {