From 63b4f81234158dfeb7d648db6dc9bc15596d95a5 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Wed, 7 Feb 2024 10:32:17 -0500 Subject: [PATCH] fix(croc) set version var closes #5135 --- projects/schollz.com/croc/package.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/projects/schollz.com/croc/package.yml b/projects/schollz.com/croc/package.yml index 561862a9..cff1f4d0 100644 --- a/projects/schollz.com/croc/package.yml +++ b/projects/schollz.com/croc/package.yml @@ -1,20 +1,32 @@ distributable: url: https://github.com/schollz/croc/archive/v{{version}}.tar.gz strip-components: 1 + versions: github: schollz/croc + build: dependencies: go.dev: '*' script: - - go build $ARGS -ldflags="-s -w" + - go build $ARGS -ldflags="$GO_LDFLAGS" env: ARGS: - -trimpath - -o={{prefix}}/bin/croc + GO_LDFLAGS: + - -s + - -w + - -X github.com/schollz/croc/v{{version.major}}/src/cli.Version={{version}} linux: ARGS: - -asan + GO_LDFLAGS: + - -buildmode=pie + provides: - bin/croc -test: croc --version | grep {{version}} \ No newline at end of file + +test: + - croc --version + - croc --version | grep {{version}}