You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
constresults=awaitp.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.
What you can also do, is not use a confirm is the folder don't exist:
constresults=awaitp.group({folder: ()=>p.text({message: "Folder name",}),overwrites: ({ results })=>{if(!folderExists(results.folder)){p.log.step('New folder, nothing to overwrite');returnPromise.resolve(false);}returnp.confirm({message: `would you like to overwrite ${results.folder}?`,}),}});
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:
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.
The text was updated successfully, but these errors were encountered: