mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
temporarily always create stage by default on projectInit
This commit is contained in:
parent
31163c4750
commit
077f63d654
@ -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
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user