pulumi new: Ensure the stack is selected (#2683)

Ensure the stack is selected when using `pulumi new` with an existing
stack (e.g. a stack created on app.pulumi.com).
This commit is contained in:
Justin Van Patten 2019-04-29 13:32:15 -07:00 committed by GitHub
parent fcfaa641b6
commit 95d51efe6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,8 @@
environment, or your `.aws/credentials` file, etc.
- The pulumi version update check can be skipped by setting the environment variable
`PULUMI_SKIP_UPDATE_CHECK` to `1` or `true`.
- Fix an issue where the stack would not be selected when an existing stack is specified when running
`pulumi new <template> -s <existing-stack>`.
### Improvements

View file

@ -25,6 +25,8 @@ import (
"strings"
"unicode"
"github.com/pulumi/pulumi/pkg/backend/state"
"github.com/pulumi/pulumi/pkg/apitype"
"github.com/pulumi/pulumi/pkg/backend"
"github.com/pulumi/pulumi/pkg/backend/display"
@ -252,6 +254,11 @@ func newNewCmd() *cobra.Command {
}
}
// Ensure the stack is selected.
if !generateOnly && s != nil {
state.SetCurrentStack(s.Ref().String())
}
// Install dependencies.
if !generateOnly {
if err := installDependencies(); err != nil {