chore: include a setup and secrets generation command in taskfile

This commit is contained in:
juancwu 2026-04-06 20:18:41 +00:00
commit 36a3d6f962

View file

@ -48,3 +48,18 @@ tasks:
- go tool templ generate - go tool templ generate
- mkdir -p ./dist - mkdir -p ./dist
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version={{.VERSION}}" -o ./dist/budgit ./cmd/server/main.go - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version={{.VERSION}}" -o ./dist/budgit ./cmd/server/main.go
setup:
desc: Sets up the local development environment
cmds:
- cp .env.include.example .env
- go-task generate-secrets
generate-secrets:
desc: Generates a random GOSHOP_APP_KEY and sets it in .env
cmds:
- |
KEY=$(openssl rand -hex 32)
sed -i "s/^JWT_SECRET=.*/JWT_SECRET=${KEY}/" .env
echo "JWT_SECRET set in .env"
silent: true
preconditions:
- test -f .env