Description
Is your feature request related to a problem? Please describe.
when using p.group I want to first ask for a folder name, then check if that folder exists, then confirm the user wants to overwrite the folder when it exists. If the folder does not yet exist, the confirm step should be skipped.
Describe the solution you'd like
a disable flag like this:
const results = await p.group({
folder: () =>
p.text({
message: "Folder name",
}),
overwrites: ({ results }) =>
p.confirm({
message: `would you like to overwrite ${results.folder}?`,
disable: !folderExists(results.folder),
}),
});
Describe alternatives you've considered
Alternatively I can split into two groups, check in between each group and manually handle the cancel.
e.g.: https://github.com/dai-shi/waku/pull/1290/files
This is ok, but less nice. Maybe there is a better way to do what I am doing here altogether though... that would be nice.
Additional context
happy to help with a PR if this is an acceptable thing to add.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status