Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 3149c71

Browse files
committed
fix: inject
1 parent a51cc75 commit 3149c71

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.goreleaser.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ builds:
1818
goos:
1919
- linux
2020
ldflags:
21-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
21+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
2222
- id: spotifox-linux-arm64
2323
main: ./cmd/spotifox.go
2424
binary: spotifox
@@ -34,7 +34,7 @@ builds:
3434
- LDFLAGS=-L/usr/aarch64-linux-gnu/lib:$LDFLAGS
3535
- PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/lib/pkgconfig:$PKG_CONFIG_PATH
3636
ldflags:
37-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
37+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
3838
- id: spotifox-linux-arm
3939
main: ./cmd/spotifox.go
4040
binary: spotifox
@@ -50,7 +50,7 @@ builds:
5050
- LDFLAGS=-L/usr/arm-linux-gnueabi/lib:$LDFLAGS
5151
- PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig:$PKG_CONFIG_PATH
5252
ldflags:
53-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
53+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
5454
- id: spotifox-windows-amd64
5555
main: ./cmd/spotifox.go
5656
binary: spotifox
@@ -59,7 +59,7 @@ builds:
5959
goos:
6060
- windows
6161
ldflags:
62-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
62+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
6363
env:
6464
- CC=/usr/local/mingw/bin/x86_64-w64-mingw32-gcc
6565
- CXX=/usr/local/mingw/bin/x86_64-w64-mingw32-g++
@@ -74,7 +74,7 @@ builds:
7474
goos:
7575
- windows
7676
ldflags:
77-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
77+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
7878
env:
7979
- CC=/usr/local/mingw/bin/aarch64-w64-mingw32-gcc
8080
- CXX=/usr/local/mingw/bin/aarch64-w64-mingw32-g++
@@ -89,7 +89,7 @@ builds:
8989
goos:
9090
- darwin
9191
ldflags:
92-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
92+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
9393
env:
9494
- CC=oa64-clang
9595
- CXX=oa64-clang++
@@ -101,7 +101,7 @@ builds:
101101
goos:
102102
- darwin
103103
ldflags:
104-
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
104+
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
105105
env:
106106
- CC=o64-clang
107107
- CXX=o64-clang++

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ INJECT_PACKAGE ?= github.com/go-musicfox/spotify/pkg/constants
44
LDFLAGS := -s -w
55
LASTFM_KEY ?=
66
LASTFM_SECRET ?=
7+
SPOTIFY_CLIENT_ID ?=
78
REGISTRY ?=
89
GORELEASER_IMAGE ?= alanalbert/goreleaser-musicfox:$(GOLANG_CROSS_VERSION)
910

@@ -80,6 +81,7 @@ release-debug-shell:
8081
-it \
8182
--rm \
8283
--privileged \
84+
--env-file .release-env \
8385
-e CGO_ENABLED=1 \
8486
-v /var/run/docker.sock:/var/run/docker.sock \
8587
-v `pwd`:/go/src/$(PACKAGE_NAME) \

internal/configs/registry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ func NewRegistryFromIniFile(filepath string) *Registry {
141141
registry.Main.DualColumn = ini.Bool("main.dualColumn", true)
142142

143143
registry.Main.LastfmKey = types.LastfmKey
144-
if key := ini.Get("main.lastfmKey"); key != "" {
144+
if key := ini.String("main.lastfmKey"); key != "" {
145145
registry.Main.LastfmKey = key
146146
}
147147
registry.Main.LastfmSecret = types.LastfmSecret
148-
if secret := ini.Get("main.lastfmSecret"); secret != "" {
148+
if secret := ini.String("main.lastfmSecret"); secret != "" {
149149
registry.Main.LastfmSecret = secret
150150
}
151151

0 commit comments

Comments
 (0)