From 8a9539ea60e27924e94db7cd2086f5ab1123ffd0 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 16 Mar 2025 02:14:25 +0000 Subject: [PATCH] Taskfile skip the generate task if templates already exist make note of --force flag. --- Taskfile.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 2472c69..776e120 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -35,19 +35,25 @@ tasks: - go fmt ./... 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: - go generate ./... + status: + - ls internal/registry/templates/gitignoreio/*.gitignore >/dev/null || exit 1 build-windows: desc: Build the gignore project for Windows cmds: - GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}} + internal: true build-linux: desc: Build the gignore project for Linux cmds: - GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}} + internal: true test: desc: Run tests