diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a71d5ec..d6e0a8c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -10,6 +10,8 @@ builds: - arm64 ldflags: - -s -w + - -X 'bbrew/internal/services.AppName={{ .ProjectName }}' + - -X 'bbrew/internal/services.AppVersion={{ .Version }}' archives: - format: tar.gz name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" diff --git a/go.mod b/go.mod index fcebabb..969911e 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,14 @@ module bbrew go 1.20 -require github.com/rivo/tview v0.0.0-20241227133733-17b7edb88c57 +require ( + github.com/gdamore/tcell/v2 v2.7.1 + github.com/joho/godotenv v1.5.1 + github.com/rivo/tview v0.0.0-20241227133733-17b7edb88c57 +) require ( github.com/gdamore/encoding v1.0.0 // indirect - github.com/gdamore/tcell/v2 v2.7.1 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/rivo/uniseg v0.4.7 // indirect diff --git a/go.sum b/go.sum index 796e6ae..d4fd4f5 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdk github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.7.1 h1:TiCcmpWHiAU7F0rA2I3S2Y4mmLmO9KHxJ7E1QhYzQbc= github.com/gdamore/tcell/v2 v2.7.1/go.mod h1:dSXtXTSK0VsW1biw65DZLZ2NKr7j0qP/0J7ONmsraWg= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= diff --git a/internal/services/app.go b/internal/services/app.go index 3a1c172..a781e57 100644 --- a/internal/services/app.go +++ b/internal/services/app.go @@ -4,14 +4,15 @@ import ( "bbrew/internal/models" "fmt" "github.com/gdamore/tcell/v2" + _ "github.com/joho/godotenv/autoload" "github.com/rivo/tview" + "os" "strings" ) -// CONSTANTS -const ( - AppName = "MyApp" - AppVersion = "1.0.0" +var ( + AppName = os.Getenv("APP_NAME") + AppVersion = os.Getenv("APP_VERSION") ) type AppServiceInterface interface {