Skip to content

Commit

Permalink
Build and reuse the executable
Browse files Browse the repository at this point in the history
For performance, do this instead of `go run`.
  • Loading branch information
zregvart committed Aug 16, 2024
1 parent 4880eb9 commit 4796292
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hack/generate-ta-tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
TASK_DIR="$(realpath "${ROOT_DIR}/task")"

tash() {
go run -C "${ROOT_DIR}/ta-generator/" github.com/konflux-ci/build-definitions/ta-generator "$@"
tashbin="$(mktemp --dry-run)"
GOTOOLCHAIN=auto go build -C "${ROOT_DIR}/ta-generator/" -o "${tashbin}"
trap 'rm "${tashbin}"' EXIT
tash() {
"${tashbin}" "$@"
}
tash "$@"
}

declare -i changes=0
Expand Down

0 comments on commit 4796292

Please sign in to comment.