pantry/projects/github.com/mvdan/sh/package.yml

32 lines
687 B
YAML
Raw Normal View History

2023-06-18 23:42:26 +03:00
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 -