+github.com/mvdan/sh

This commit is contained in:
Branch Vincent 2023-06-18 13:42:26 -07:00 committed by Jacob Heider
parent c577e315c9
commit 2dc39b4d51

View file

@ -0,0 +1,31 @@
distributable:
url: https://github.com/mvdan/sh/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
versions:
github: mvdan/sh/releases/tags
strip: /^v/
build:
dependencies:
go.dev: ^1.19
env:
CGO_ENABLED: 0
LDFLAGS:
- -s
- -w
- -extldflags=-static
- -X main.version={{version}}
script: |
go build -v -ldflags="$LDFLAGS" -o "{{ prefix }}"/bin/gosh ./cmd/gosh
go build -v -ldflags="$LDFLAGS" -o "{{ prefix }}"/bin/shfmt ./cmd/shfmt
provides:
- bin/gosh
- bin/shfmt
test:
script: |
test "$(gosh -c 'echo success')" = success
test "$(shfmt --version)" = {{version}}
echo "f() { true; }" | shfmt --diff -