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:
parent
fcfaa641b6
commit
95d51efe6a
|
@ -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
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue