temporarily always create stage by default on projectInit

This commit is contained in:
Eslam A. Hefnawy 2016-03-22 13:50:07 +07:00
parent 31163c4750
commit 077f63d654

View File

@ -261,38 +261,50 @@ module.exports = function(S) {
let _this = this;
let choices = [{
key: '',
value: true,
label: 'Yes'
}, {
key: '',
value: false,
label: 'No'
}];
return S.actions.stageCreate({
options: {
stage: _this.evt.options.stage,
region: _this.evt.options.region,
profile: _this.evt.options.profile,
noExeCf: _this.evt.options.noExeCf ? true : false
}
});
return BbPromise
.try(() => {
// If interactive, skip
if (!S.config.interactive) return true;
return _this.cliPromptSelect('Do you want to create a new stage and region for this project? ', choices, false)
.then(results => results[0].value)
})
.then(answer => {
if (answer) {
return S.actions.stageCreate({
options: {
stage: _this.evt.options.stage,
region: _this.evt.options.region,
profile: _this.evt.options.profile,
noExeCf: _this.evt.options.noExeCf ? true : false
}
});
}
});
// The Select prompt conflicts and causes the double input issue
// commented out for now till we fix our prompts
// ==============================================================
//let choices = [{
// key: '',
// value: true,
// label: 'Yes'
//}, {
// key: '',
// value: false,
// label: 'No'
//}];
//
//return BbPromise
// .try(() => {
//
// // If interactive, skip
// if (!S.config.interactive) return true;
//
// return _this.cliPromptSelect('Do you want to create a new stage and region for this project? ', choices, false)
// .then(results => results[0].value)
// })
// .then(answer => {
//
// if (answer) {
// return S.actions.stageCreate({
// options: {
// stage: _this.evt.options.stage,
// region: _this.evt.options.region,
// profile: _this.evt.options.profile,
// noExeCf: _this.evt.options.noExeCf ? true : false
// }
// });
// }
// });
}
}