Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
fixed version
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Aug 17, 2017
1 parent 83fb9c4 commit e431f7d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
8 changes: 3 additions & 5 deletions samples/godownloader-goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ adjust_version() {
echo "$PREFIX: checking GitHub for latest version"
VERSION=$(github_last_release "$OWNER/$REPO")
fi
# if version starts with 'v', remove it
VERSION=${VERSION#v}
}
adjust_format() {
# change format (tar.gz or zip) based on ARCH
Expand Down Expand Up @@ -323,9 +321,9 @@ echo "$PREFIX: found version ${VERSION} for ${OS}/${ARCH}"

NAME=${BINARY}_${OS}_${ARCH}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${TARBALL}
CHECKSUM=${BINARY}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${CHECKSUM}
TARBALL_URL=${GITHUB_DOWNLOAD}/${VERSION}/${TARBALL}
CHECKSUM=goreleaser_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${VERSION}/${CHECKSUM}

# Adjust binary name if windows
if [ "$OS" = "windows" ]; then
Expand Down
8 changes: 3 additions & 5 deletions samples/godownloader-hugo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ adjust_version() {
echo "$PREFIX: checking GitHub for latest version"
VERSION=$(github_last_release "$OWNER/$REPO")
fi
# if version starts with 'v', remove it
VERSION=${VERSION#v}
}
adjust_format() {
# change format (tar.gz or zip) based on ARCH
Expand Down Expand Up @@ -358,9 +356,9 @@ echo "$PREFIX: found version ${VERSION} for ${OS}/${ARCH}"

NAME=${BINARY}_${VERSION}_${OS}-${ARCH}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${TARBALL}
CHECKSUM=${BINARY}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${CHECKSUM}
TARBALL_URL=${GITHUB_DOWNLOAD}/${VERSION}/${TARBALL}
CHECKSUM=hugo_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${VERSION}/${CHECKSUM}

# Adjust binary name if windows
if [ "$OS" = "windows" ]; then
Expand Down
8 changes: 3 additions & 5 deletions samples/godownloader-misspell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ adjust_version() {
echo "$PREFIX: checking GitHub for latest version"
VERSION=$(github_last_release "$OWNER/$REPO")
fi
# if version starts with 'v', remove it
VERSION=${VERSION#v}
}
adjust_format() {
# change format (tar.gz or zip) based on ARCH
Expand Down Expand Up @@ -308,9 +306,9 @@ echo "$PREFIX: found version ${VERSION} for ${OS}/${ARCH}"

NAME=${BINARY}_${VERSION}_${OS}_${ARCH}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${TARBALL}
CHECKSUM=${BINARY}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${CHECKSUM}
TARBALL_URL=${GITHUB_DOWNLOAD}/${VERSION}/${TARBALL}
CHECKSUM=misspell_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${VERSION}/${CHECKSUM}

# Adjust binary name if windows
if [ "$OS" = "windows" ]; then
Expand Down
12 changes: 6 additions & 6 deletions scripts/build_samples.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh -ex

./godownloader -repo gohugoio/hugo > samples/godownloader-hugo.sh
./godownloader -repo goreleaser/goreleaser > samples/godownloader-goreleaser.sh
./godownloader -repo client9/misspell > samples/godownloader-misspell.sh
./godownloader -source equinoxio -repo tdewolff/minify > samples/godownloader-minify.sh
./godownloader -source raw -repo mvdan/sh -exe shfmt > samples/godownloader-shfmt.sh
./godownloader -repo gohugoio/hugo >samples/godownloader-hugo.sh
./godownloader -repo goreleaser/goreleaser >samples/godownloader-goreleaser.sh
./godownloader -repo client9/misspell >samples/godownloader-misspell.sh
./godownloader -source equinoxio -repo tdewolff/minify >samples/godownloader-minify.sh
./godownloader -source raw -repo mvdan/sh -exe shfmt >samples/godownloader-shfmt.sh
./godownloader -repo serverless/event-gateway >samples/godownloader-event-gateway.sh
chmod a+x samples/*.sh
8 changes: 3 additions & 5 deletions shell_godownloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ adjust_version() {
echo "$PREFIX: checking GitHub for latest version"
VERSION=$(github_last_release "$OWNER/$REPO")
fi
# if version starts with 'v', remove it
VERSION=${VERSION#v}
}
adjust_format() {
# change format (tar.gz or zip) based on ARCH
Expand Down Expand Up @@ -177,9 +175,9 @@ echo "$PREFIX: found version ${VERSION} for ${OS}/${ARCH}"
{{ .Archive.NameTemplate }}
TARBALL=${NAME}.${FORMAT}
TARBALL_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${TARBALL}
CHECKSUM=${BINARY}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/v${VERSION}/${CHECKSUM}
TARBALL_URL=${GITHUB_DOWNLOAD}/${VERSION}/${TARBALL}
CHECKSUM={{.ProjectName}}_checksums.txt
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${VERSION}/${CHECKSUM}
# Adjust binary name if windows
if [ "$OS" = "windows" ]; then
Expand Down

0 comments on commit e431f7d

Please sign in to comment.