Skip to content

Commit

Permalink
compose-image-yml: use system yq if available
Browse files Browse the repository at this point in the history
otherwise download it from github

Signed-off-by: Christoph Ostarek <[email protected]>
  • Loading branch information
christoph-zededa committed Jul 10, 2024
1 parent fd02b02 commit 8bdfa40
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/compose-image-yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
set -e

yq() {
docker run -i --rm -v "${PWD}/":/workdir -w /workdir mikefarah/yq:4.40.5 "$@"
if yq --version | grep -cq v4.4
then
yq "$@"
elif go --version 2>/dev/null
go run github.com/mikefarah/yq/[email protected] "$@"
else
docker run -i --rm -v "${PWD}/":/workdir -w /workdir mikefarah/yq:4.40.5 "$@"
fi
}

process-image-template() {
Expand Down

0 comments on commit 8bdfa40

Please sign in to comment.