Skip to content

Commit e97c37f

Browse files
fix: node add call triggers no prompt found for local-build-path erro… (#517)
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent d5acbe3 commit e97c37f

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

src/commands/flags.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,17 @@ export const allFlags = [
725725
valuesFile
726726
]
727727

728+
/**
729+
* Resets the definition.disablePrompt for all flags
730+
*/
731+
export function resetDisabledPrompts () {
732+
allFlags.forEach(f => {
733+
if (f.definition.disablePrompt) {
734+
delete f.definition.disablePrompt
735+
}
736+
})
737+
}
738+
728739
export const allFlagsMap = new Map(allFlags.map(f => [f.name, f]))
729740

730741
export const nodeConfigFileFlags = new Map([

src/commands/node.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,8 @@ export class NodeCommand extends BaseCommand {
11941194
// disable the prompts that we don't want to prompt the user for
11951195
prompts.disablePrompts([
11961196
flags.devMode,
1197-
flags.force
1197+
flags.force,
1198+
flags.localBuildPath
11981199
])
11991200

12001201
await prompts.execute(task, self.configManager, NodeCommand.REFRESH_FLAGS_LIST)
@@ -1452,6 +1453,7 @@ export class NodeCommand extends BaseCommand {
14521453
flags.endpointType,
14531454
flags.force,
14541455
flags.fstChartVersion,
1456+
flags.localBuildPath,
14551457
flags.gossipEndpoints,
14561458
flags.grpcEndpoints
14571459
])

src/commands/prompts.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
2020
import { ConfigManager, constants } from '../core/index.mjs'
2121
import * as flags from './flags.mjs'
2222
import * as helpers from '../core/helpers.mjs'
23+
import { resetDisabledPrompts } from './flags.mjs'
2324

2425
async function prompt (type, task, input, defaultValue, promptMessage, emptyCheckMessage, flagName) {
2526
try {
@@ -531,6 +532,7 @@ export async function execute (task, configManager, flagList = []) {
531532
* @param {CommandFlag[]} flags list of flags to disable prompts for
532533
*/
533534
export function disablePrompts (flags) {
535+
resetDisabledPrompts()
534536
for (const flag of flags) {
535537
if (flag.definition) {
536538
flag.definition.disablePrompt = true

test/e2e/commands/node-add.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('Node add', () => {
7575
flags.devMode.constName
7676
])
7777
await nodeCmd.accountManager.close()
78-
}, 600000)
78+
}, 800000)
7979

8080
balanceQueryShouldSucceed(nodeCmd.accountManager, nodeCmd, namespace)
8181

0 commit comments

Comments
 (0)