Skip to content

Commit 36bc517

Browse files
committed
chore(yq): change to golang build
1 parent 6e30141 commit 36bc517

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

stacks/yq/build.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ function build() {
88
generate-stack-path
99
BIN_DIR="${DATA_DIR}"/bin
1010
mkdir -p "${BIN_DIR}"
11-
architecture=$(dpkg --print-architecture)
12-
curl -o "${BIN_DIR}"/yq \
13-
-L "https://github.com/mikefarah/yq/releases/download/v${STACK_VERSION}/yq_linux_$architecture"; \
14-
chmod +x "${BIN_DIR}"/yq
11+
install-stack go "${GO_VERSION}"
12+
. init-stack
13+
curl -fsSL -o tmp.tar.gz https://github.com/mikefarah/yq/archive/refs/tags/v${STACK_VERSION}.tar.gz
14+
tar -xvzf tmp.tar.gz
15+
cd yq-${STACK_VERSION}
16+
# fix CVE-2022-28948
17+
go get -u ./...; go mod tidy; go mod vendor
18+
19+
go build -o "${BIN_DIR}"/yq
20+
cd ..
21+
rm -rf yq-${STACK_VERSION} tmp.tar.gz
1522
}
1623

1724
# call build stack

0 commit comments

Comments
 (0)