Skip to content

Commit

Permalink
build(task): simplify and make more DRY
Browse files Browse the repository at this point in the history
Use the `for` loop built into Task.
  • Loading branch information
dbohdan committed Dec 6, 2024
1 parent 87417c9 commit ac75342
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ tasks:
- memsparkline

build_test_binaries:
desc: 'Build all test binaries'
deps:
- build_test_sleep

build_test_sleep:
desc: 'Build the test binaries'
cmds:
- task: build_binary
vars:
src: test/sleep.go
out: test/sleep
src: '{{.test_binary}}.go'
out: '{{.test_binary}}'
for:
var: test_binaries
as: test_binary
sources:
- test/sleep.go
generates:
Expand All @@ -68,7 +67,10 @@ tasks:
desc: 'Clean up binaries'
cmds:
- rm -f memsparkline
- rm -f {{range .test_binaries | splitLines }}{{. | shellQuote}} {{end}}
- cmd: rm -f {{.test_binary | shellQuote}}
for:
var: test_binaries
as: test_binary

release:
desc: 'Prepare a release'
Expand Down

0 comments on commit ac75342

Please sign in to comment.