Skip to content

Commit

Permalink
fix detecthing in what bucket are functions
Browse files Browse the repository at this point in the history
Tag can be equal to version for but not strictly on tag.
  • Loading branch information
ianic committed Sep 28, 2021
1 parent 732369b commit 91c7c7e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cli/commands/setup/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package setup
import (
"fmt"
"os"
"strings"
)

type Version struct {
Expand All @@ -20,17 +21,10 @@ func (v *Version) String() string {
return v.Version
}

func (v *Version) isPublished() bool {
if v.Version == "" && v.Tag == "" {
return false
}
return v.Version == v.Tag
}

// published versions get replicated through the regions, dev ones are only located in central bucket
func (v *Version) setupBucket(region string) string {
bucket := "mantil-downloads"
if v.isPublished() {
if !strings.HasPrefix(v.FunctionsPath, "dev/") {
bucket = fmt.Sprintf("%s-%s", bucket, region)
}
return bucket
Expand Down

0 comments on commit 91c7c7e

Please sign in to comment.