mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 08:25:07 +03:00
+shfmt
This commit is contained in:
parent
80e86a2430
commit
5c14cca70b
1 changed files with 33 additions and 0 deletions
33
projects/mvdan.cc/sh/package.yml
Normal file
33
projects/mvdan.cc/sh/package.yml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/mvdan/sh/archive/refs/tags/{{ version.tag }}.tar.gz
|
||||||
|
strip-components: 1
|
||||||
|
|
||||||
|
versions:
|
||||||
|
github: mvdan/sh
|
||||||
|
|
||||||
|
provides:
|
||||||
|
- bin/shfmt
|
||||||
|
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
go.dev: ^1.21
|
||||||
|
script:
|
||||||
|
- go mod download
|
||||||
|
- go build -v -trimpath -ldflags="$GO_LDFLAGS" -o '{{prefix}}/bin/shfmt' ./cmd/shfmt
|
||||||
|
env:
|
||||||
|
GO_LDFLAGS:
|
||||||
|
- -s
|
||||||
|
- -w
|
||||||
|
- -X main.version=v{{version}}
|
||||||
|
linux:
|
||||||
|
# or segmentation fault
|
||||||
|
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
|
||||||
|
LDFLAGS:
|
||||||
|
- -buildmode=pie
|
||||||
|
|
||||||
|
test:
|
||||||
|
- test "$(shfmt --version)" = "v{{version}}"
|
||||||
|
- run: test "$(echo 'echo "hello world"; echo 42' | shfmt)" = "$(cat $FIXTURE)"
|
||||||
|
fixture: |
|
||||||
|
echo "hello world"
|
||||||
|
echo 42
|
Loading…
Reference in a new issue