Skip to content

BUG: When I add validation to a prompt schema, the name is outputted instead of the description when prompting. #69

@trusktr

Description

@trusktr

e.g. If I do this:

var promptProperties = [                                                                                                                                   
     {
         description: "Enter your username",
         name: 'username',
         validator: /^[a-zAZ0-9\._-]+$/,
         warning: 'Username must be only letters and/or numbers'
     },
     {
         description: "Enter your password",
         name: 'password',
         hidden: true
     },  
     {
         description: "Enter the message subject",
         name: 'subject'
     },  
     {
         description: "Enter the email message",
         name: 'message'
     }
];

then the first prompt shows prompt: username: but if I do

var promptProperties = [                                                                                                                                   
     {
         description: "Enter your username",
         name: 'username',
     },
     {
         description: "Enter your password",
         name: 'password',
         hidden: true
     },  
     {
         description: "Enter the message subject",
         name: 'subject'
     },  
     {
         description: "Enter the email message",
         name: 'message'
     }   
];

then the first prompt shows prompt: Enter your username: as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions