From 26ca66bd9a85b4f239be2011b159b5de6ed2d9da Mon Sep 17 00:00:00 2001 From: shamsartem Date: Wed, 17 Apr 2024 11:42:55 +0200 Subject: [PATCH] fix: don't interactively ask for the env in `fluence default peers` command when env is provided as an arg [fixes DXJ-775] (#907) --- src/commands/default/peers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/default/peers.ts b/src/commands/default/peers.ts index bf891a6b7..c1d73f3b2 100644 --- a/src/commands/default/peers.ts +++ b/src/commands/default/peers.ts @@ -15,8 +15,9 @@ */ import { BaseCommand, baseFlags } from "../../baseCommand.js"; +import { setChainFlags } from "../../lib/chainFlags.js"; import { commandObj } from "../../lib/commandObj.js"; -import { ENV_ARG } from "../../lib/const.js"; +import { ENV_ARG, ENV_ARG_NAME, ENV_FLAG_NAME } from "../../lib/const.js"; import { initCli } from "../../lib/lifeCycle.js"; import { resolveRelays } from "../../lib/multiaddres.js"; @@ -30,7 +31,8 @@ export default class Peers extends BaseCommand { ...ENV_ARG, }; async run(): Promise { - await initCli(this, await this.parse(Peers)); + const { args } = await initCli(this, await this.parse(Peers)); + setChainFlags({ [ENV_FLAG_NAME]: args[ENV_ARG_NAME] }); const relays = await resolveRelays(); commandObj.log(relays.join("\n")); }