Skip to content

Commit

Permalink
restore the original environment name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zimbatm committed May 1, 2019
1 parent 5111335 commit 2470bc3
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions command/please.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"errors"
"fmt"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -53,15 +54,9 @@ func CmdPlease(c *cli.Context) (err error) {
}
}

// If the environment is not set, set as follows:
// * branch is master: production
// * otherwise: pr-preview
if environment == "" {
if branch == "master" {
environment = "production"
} else {
environment = "pr-preview"
}
// Override the deployment target on pull-request
if pr > 0 {
environment = fmt.Sprintf("pr-%d", pr)
}

ctx := context.Background()
Expand Down

0 comments on commit 2470bc3

Please sign in to comment.