This commit is contained in:
abs3nt 2024-02-23 12:48:32 -08:00
parent c26d11299a
commit dc2c74dd4b
Signed by: abs3nt
GPG Key ID: A7BD96A8BAB04C09
3 changed files with 32 additions and 2 deletions

View File

@ -10,7 +10,6 @@ before:
builds:
- env:
- CGO_ENABLED=0
main: ./cmd/gspot
goos:
- linux
- windows

View File

@ -1,5 +1,5 @@
build:
go build -ldflags="-X 'git.asdf.cafe/abs3nt/gspot/src/components/cli.Version=$(shell git show -s --date=short --pretty='format:%h (%ad)' HEAD)'" -o dist/ ./cmd/gspot
go build -ldflags="-X 'git.asdf.cafe/abs3nt/gspot/src/components/cli.Version=$(shell git show -s --date=short --pretty='format:%h (%ad)' HEAD)'" -o dist/ .
run: build
./dist/gspot

31
main.go Normal file
View File

@ -0,0 +1,31 @@
package main
import (
"gfx.cafe/util/go/fxplus"
"go.uber.org/fx"
"git.asdf.cafe/abs3nt/gspot/src/components/cache"
"git.asdf.cafe/abs3nt/gspot/src/components/cli"
"git.asdf.cafe/abs3nt/gspot/src/components/commands"
"git.asdf.cafe/abs3nt/gspot/src/components/logger"
"git.asdf.cafe/abs3nt/gspot/src/services"
)
func main() {
var s fx.Shutdowner
app := fx.New(
fxplus.WithLogger,
fx.Populate(&s),
services.Config,
fx.Provide(
fxplus.Context,
cache.NewCache,
commands.NewCommander,
logger.NewLogger,
),
fx.Invoke(
cli.Run,
),
)
app.Run()
}