@@ -150,8 +150,8 @@ func NewCmdPromote(f factory.Factory) *cobra.Command {
150150 promoteFlags := NewPromoteFlags ()
151151 cmd := & cobra.Command {
152152 Use : "promote" ,
153- Short : "Promote releases " ,
154- Long : "Promote releases in Octopus Deploy" ,
153+ Short : "Promote release " ,
154+ Long : "Promote release in Octopus Deploy" ,
155155 Example : heredoc .Docf (`
156156 $ %[1]s release promote # fully interactive
157157 $ %[1]s release promote -p MyProject --version 1.0 -source-env Dev -e Staging --environment Production --skip InstallStep --variable VarName:VarValue
@@ -435,20 +435,8 @@ func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker ques
435435 return err
436436 }
437437
438- // select release
439-
440438 var selectedRelease * releases.Release
441439 var selectedChannel * channels.Channel
442- if options .SourceEnvironment == "" {
443- selectedSourceEnvironment , err := selectors .EnvironmentSelect (asker , func () ([]* environments.Environment , error ) {
444- return selectors .GetAllEnvironments (octopus )
445- }, "Select source environment" )
446- if err != nil {
447- return err
448- }
449- _ , _ = fmt .Fprintf (stdout , "Source Environment %s\n " , output .Cyan (selectedSourceEnvironment .Name ))
450- options .SourceEnvironment = selectedSourceEnvironment .Name
451- }
452440 if options .ReleaseVersion == "" {
453441 // first we want to ask them to pick a channel just to narrow down the search space for releases (not sent to server)
454442 selectedChannel , err = selectors .Channel (octopus , asker , stdout , "Select channel" , selectedProject )
@@ -484,6 +472,16 @@ func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker ques
484472 }
485473 }
486474
475+ if options .SourceEnvironment == "" {
476+ selectedSourceEnvironment , err := selectors .EnvironmentSelect (asker , func () ([]* environments.Environment , error ) {
477+ return selectors .GetAllEnvironments (octopus )
478+ }, "Select source environment" )
479+ if err != nil {
480+ return err
481+ }
482+ _ , _ = fmt .Fprintf (stdout , "Source Environment %s\n " , output .Cyan (selectedSourceEnvironment .Name ))
483+ options .SourceEnvironment = selectedSourceEnvironment .Name
484+ }
487485 // machine selection later on needs to refer back to the environments.
488486 // NOTE: this is allowed to remain nil; environments will get looked up later on if needed
489487 var deploymentEnvironmentIDs []string
0 commit comments