Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: node add call triggers no prompt found for local-build-path erro… #517

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/commands/flags.mjs
Original file line number Diff line number Diff line change
@@ -725,6 +725,17 @@ export const allFlags = [
valuesFile
]

/**
* Resets the definition.disablePrompt for all flags
*/
export function resetDisabledPrompts () {
allFlags.forEach(f => {
if (f.definition.disablePrompt) {
delete f.definition.disablePrompt
}
})
}

export const allFlagsMap = new Map(allFlags.map(f => [f.name, f]))

export const nodeConfigFileFlags = new Map([
4 changes: 3 additions & 1 deletion src/commands/node.mjs
Original file line number Diff line number Diff line change
@@ -1194,7 +1194,8 @@ export class NodeCommand extends BaseCommand {
// disable the prompts that we don't want to prompt the user for
prompts.disablePrompts([
flags.devMode,
flags.force
flags.force,
flags.localBuildPath
])

await prompts.execute(task, self.configManager, NodeCommand.REFRESH_FLAGS_LIST)
@@ -1452,6 +1453,7 @@ export class NodeCommand extends BaseCommand {
flags.endpointType,
flags.force,
flags.fstChartVersion,
flags.localBuildPath,
flags.gossipEndpoints,
flags.grpcEndpoints
])
2 changes: 2 additions & 0 deletions src/commands/prompts.mjs
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
import { ConfigManager, constants } from '../core/index.mjs'
import * as flags from './flags.mjs'
import * as helpers from '../core/helpers.mjs'
import { resetDisabledPrompts } from './flags.mjs'

async function prompt (type, task, input, defaultValue, promptMessage, emptyCheckMessage, flagName) {
try {
@@ -531,6 +532,7 @@ export async function execute (task, configManager, flagList = []) {
* @param {CommandFlag[]} flags list of flags to disable prompts for
*/
export function disablePrompts (flags) {
resetDisabledPrompts()
for (const flag of flags) {
if (flag.definition) {
flag.definition.disablePrompt = true
2 changes: 1 addition & 1 deletion test/e2e/commands/node-add.test.mjs
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ describe('Node add', () => {
flags.devMode.constName
])
await nodeCmd.accountManager.close()
}, 600000)
}, 800000)

balanceQueryShouldSucceed(nodeCmd.accountManager, nodeCmd, namespace)

Loading