generators/aws-containers/prompts.js
function askCloudFormation() {
    if (this.abort) return null;
    const done = this.async();
    const prompts = [
        {
            type: 'input',
            name: 'cloudFormationName',
            message: "Please enter your stack's name. (must be unique within a region)",
            default: this.aws.cloudFormationName || this.baseName,
            validate: input => {
                if (_.isEmpty(input) || !input.match(CLOUDFORMATION_STACK_NAME)) {
                    return 'Stack name must contain letters, digits, or hyphens ';
                }
                return true;
            }
        }
    ];

    return this.prompt(prompts).then(props => {
        const cloudFormationName = props.cloudFormationName;
        if (cloudFormationName) {
            this.aws.cloudFormationName = cloudFormationName;
            while (this.aws.cloudFormationName.includes('_')) {
                this.aws.cloudFormationName = _.replace(this.aws.cloudFormationName, '_', '');
            }
            this.log(`CloudFormation Stack name will be ${this.aws.cloudFormationName}`);
            done();
        } else {
            this.abort = true;
            done();
        }
    });
}
function askCloudFormation() {
    if (this.abort) return null;
    const done = this.async();
    const prompts = [
        {
            type: 'input',
            name: 'cloudFormationName',
            message: "Please enter your stack's name. (must be unique within a region)",
            default: this.aws.cloudFormationName || this.baseName,
            validate: input => {
                if (_.isEmpty(input) || !input.match(CLOUDFORMATION_STACK_NAME)) {
                    return 'Stack name must contain letters, digits, or hyphens ';
                }
                return true;
            }
        }
    ];

    return this.prompt(prompts).then(props => {
        const cloudFormationName = props.cloudFormationName;
        if (cloudFormationName) {
            this.aws.cloudFormationName = cloudFormationName;
            while (this.aws.cloudFormationName.includes('_')) {
                this.aws.cloudFormationName = _.replace(this.aws.cloudFormationName, '_', '');
            }
            this.log(`CloudFormation Stack name will be ${this.aws.cloudFormationName}`);
            done();
        } else {
            this.abort = true;
            done();
        }
    });
}
function askCloudFormation ( ) { if ( this . abort ) return null ; const done = this . async ( ) ; const prompts = [ { type : 'input' , name : 'cloudFormationName' , message : "Please enter your stack's name. (must be unique within a region)" , default : this . aws . cloudFormationName || this . baseName , validate : input => { if ( _ . isEmpty ( input ) || ! input . match ( CLOUDFORMATION_STACK_NAME ) ) { return 'Stack name must contain letters, digits, or hyphens ' ; } return true ; } } ] ; return this . prompt ( prompts ) . then ( props => { const cloudFormationName = props . cloudFormationName ; if ( cloudFormationName ) { this . aws . cloudFormationName = cloudFormationName ; while ( this . aws . cloudFormationName . includes ( '_' ) ) { this . aws . cloudFormationName = _ . replace ( this . aws . cloudFormationName , '_' , '' ) ; } this . log ( ` ${ this . aws . cloudFormationName } ` ) ; done ( ) ; } else { this . abort = true ; done ( ) ; } } ) ; }
Ask user for CloudFormation name.
Ask user for CloudFormation name .