Skip to content

Commit

Permalink
chore(build): wrong urls are passed
Browse files Browse the repository at this point in the history
  • Loading branch information
aybabtme committed Oct 21, 2024
1 parent 4aff753 commit 3499570
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .goreleaser-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ builds:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr="https://api.humanlog.dev -X main.defaultBaseSiteAddr="https://humanlog.dev"
- -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease=next.{{ .CommitTimestamp }} -X main.versionBuild={{.ShortCommit}} -X main.defaultApiAddr=https://api.humanlog.dev -X main.defaultBaseSiteAddr=https://humanlog.dev
goos:
# - windows
- darwin
Expand Down
8 changes: 7 additions & 1 deletion cmd/humanlog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,13 @@ func newApp() *cli.App {
return getKeyring(cctx)
})
}
getAPIUrl = func(*cli.Context) string { logdebug("using api at %q", apiURL); return apiURL }
getAPIUrl = func(*cli.Context) string {
if apiURL == "" {
apiURL = defaultApiAddr
}
logdebug("using api at %q", apiURL)
return apiURL
}
getBaseSiteURL = func(*cli.Context) string {
if baseSiteURL == "" {
baseSiteURL = defaultBaseSiteAddr
Expand Down
2 changes: 1 addition & 1 deletion cmd/humanlog/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func versionCmd(
getCfg func(cctx *cli.Context) *config.Config,
getState func(cctx *cli.Context) *state.State,
getTokenSource func(cctx *cli.Context) *auth.UserRefreshableTokenSource,
getBaseSiteURL func(cctx *cli.Context) string,
getAPIUrl func(cctx *cli.Context) string,
getBaseSiteURL func(cctx *cli.Context) string,
getHTTPClient func(*cli.Context) *http.Client,
) cli.Command {
return cli.Command{
Expand Down

0 comments on commit 3499570

Please sign in to comment.