Taskfile skip the generate task if templates already exist
Some checks failed
Auto-Update Go Modules / update-go-modules (push) Has been cancelled

make note of --force flag.
This commit is contained in:
onyx-and-iris 2025-03-16 02:14:25 +00:00
parent 626e40b653
commit 8a9539ea60

View File

@ -35,19 +35,25 @@ tasks:
- go fmt ./... - go fmt ./...
generate: generate:
desc: Generate the gitignore.io templates desc: |
Generate the gitignore.io templates. This task will be skipped if the templates already exist.
You may use the `--force` flag to regenerate the templates.
cmds: cmds:
- go generate ./... - go generate ./...
status:
- ls internal/registry/templates/gitignoreio/*.gitignore >/dev/null || exit 1
build-windows: build-windows:
desc: Build the gignore project for Windows desc: Build the gignore project for Windows
cmds: cmds:
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}} - GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}
internal: true
build-linux: build-linux:
desc: Build the gignore project for Linux desc: Build the gignore project for Linux
cmds: cmds:
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}} - GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}
internal: true
test: test:
desc: Run tests desc: Run tests