mirror of https://github.com/hrfee/jfa-go
parent
92332206f0
commit
eb8f2777ae
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
TAR_FILE="/tmp/goreleaser.tar.gz"
|
||||
RELEASES_URL="https://github.com/goreleaser/goreleaser/releases"
|
||||
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
|
||||
|
||||
last_version() {
|
||||
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/latest" |
|
||||
rev |
|
||||
cut -f1 -d'/'|
|
||||
rev
|
||||
}
|
||||
|
||||
download() {
|
||||
test -z "$VERSION" && VERSION="$(last_version)"
|
||||
test -z "$VERSION" && {
|
||||
echo "Unable to get goreleaser version." >&2
|
||||
exit 1
|
||||
}
|
||||
rm -f "$TAR_FILE"
|
||||
curl -s -L -o "$TAR_FILE" \
|
||||
"$RELEASES_URL/download/$VERSION/goreleaser_$(uname -s)_$(uname -m).tar.gz"
|
||||
}
|
||||
|
||||
download
|
||||
tar -xf "$TAR_FILE" -C "$TMPDIR"
|
||||
"${TMPDIR}/goreleaser" "$@"
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
VERSION=$(git describe --exact-match HEAD 2> /dev/null || echo 'vgit')
|
||||
VERSION="$(echo $VERSION | sed 's/v//g')" $@
|
||||
JFA_GO_VERSION=$(git describe --exact-match HEAD 2> /dev/null || echo 'vgit')
|
||||
JFA_GO_VERSION="$(echo $JFA_GO_VERSION | sed 's/v//g')" $@
|
||||
|
Loading…
Reference in new issue