Skip to content

Commit

Permalink
Merge pull request #69 from theBeginner86/thebeginner86/chore/3
Browse files Browse the repository at this point in the history
[chore] Fix env variables
  • Loading branch information
theBeginner86 authored Nov 27, 2024
2 parents d8cd451 + 09a748e commit dfcad30
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ builds:
ldflags:
- -s -w
- -X main.providerToken={{.Env.PROVIDER_TOKEN}}
- -X main.MesheryCloudAPIBaseURL="https://cloud.layer5.io"
- -X main.MesheryAPIBaseURL="https://playground.meshery.io"
- -X main.mesheryCloudAPIBaseURL="https://cloud.layer5.io"
- -X main.mesheryAPIBaseURL="https://playground.meshery.io"
goos:
- linux
- darwin
Expand Down
5 changes: 4 additions & 1 deletion cmd/kanvas-snapshot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ func isValidEmail(email string) bool {
return emailRegex.MatchString(email)
}

func Main() {
func Main(providerToken, mesheryCloudAPIBaseURL, mesheryAPIBaseURL string) {
ProviderToken = providerToken
MesheryCloudAPIBaseURL = mesheryCloudAPIBaseURL
MesheryAPIBaseURL = mesheryAPIBaseURL
generateKanvasSnapshotCmd.Flags().StringVarP(&chartURI, "file", "f", "", "URI to Helm chart (required)")
generateKanvasSnapshotCmd.Flags().StringVarP(&designName, "design-name", "n", "", "Optional name for the Meshery design")
generateKanvasSnapshotCmd.Flags().StringVarP(&email, "email", "e", "", "Optional email to associate with the Meshery design")
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import (
cmd "github.com/meshery/helm-kanvas-snapshot/cmd/kanvas-snapshot"
)

var (
providerToken string
mesheryCloudAPIBaseURL string
mesheryAPIBaseURL string
)

func main() {
cmd.Main()
cmd.Main(providerToken, mesheryCloudAPIBaseURL, mesheryAPIBaseURL)
}

0 comments on commit dfcad30

Please sign in to comment.