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

Commit

Permalink
Close #13 - change default TMPDIR behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed May 10, 2017
1 parent 09d06ad commit 1e1684c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion main.go
Expand Up @@ -23,7 +23,7 @@ FORMAT={{ .Archive.Format }}
OWNER={{ $.Release.GitHub.Owner }}
REPO={{ $.Release.GitHub.Name }}
BINDIR=${BINDIR:-./bin}
TMPDIR=${TMPDIR:-/tmp}
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
VERSION=$1
if [ -z "${VERSION}" ]; then
Expand Down Expand Up @@ -94,6 +94,7 @@ esac
TARBALL=${NAME}.${FORMAT}
URL=https://github.com/${OWNER}/${REPO}/releases/download/v${VERSION}/${TARBALL}
mkdir -p ${TMPDIR}
rm -f ${TMPDIR}/${TARBALL}
download ${TMPDIR}/${TARBALL} ${URL}
tar -C ${TMPDIR} -xzf ${TMPDIR}/${TARBALL}
Expand Down
4 changes: 3 additions & 1 deletion samples/godownloader-goreleaser.sh
Expand Up @@ -6,7 +6,7 @@ FORMAT=tar.gz
OWNER=goreleaser
REPO=goreleaser
BINDIR=${BINDIR:-./bin}
TMPDIR=${TMPDIR:-/tmp}
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"

VERSION=$1
if [ -z "${VERSION}" ]; then
Expand Down Expand Up @@ -66,6 +66,8 @@ NAME=${BINARY}_${OS}_${ARCH}${ARM}
TARBALL=${NAME}.${FORMAT}
URL=https://github.com/${OWNER}/${REPO}/releases/download/v${VERSION}/${TARBALL}

mkdir -p ${TMPDIR}
rm -f ${TMPDIR}/${TARBALL}
download ${TMPDIR}/${TARBALL} ${URL}
tar -C ${TMPDIR} -xzf ${TMPDIR}/${TARBALL}
install -d ${BINDIR}
Expand Down
4 changes: 3 additions & 1 deletion samples/godownloader-hugo.sh
Expand Up @@ -6,7 +6,7 @@ FORMAT=tar.gz
OWNER=spf13
REPO=hugo
BINDIR=${BINDIR:-./bin}
TMPDIR=${TMPDIR:-/tmp}
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"

VERSION=$1
if [ -z "${VERSION}" ]; then
Expand Down Expand Up @@ -83,6 +83,8 @@ NAME=${BINARY}_${VERSION}_${OS}-${ARCH}
TARBALL=${NAME}.${FORMAT}
URL=https://github.com/${OWNER}/${REPO}/releases/download/v${VERSION}/${TARBALL}

mkdir -p ${TMPDIR}
rm -f ${TMPDIR}/${TARBALL}
download ${TMPDIR}/${TARBALL} ${URL}
tar -C ${TMPDIR} -xzf ${TMPDIR}/${TARBALL}
install -d ${BINDIR}
Expand Down

0 comments on commit 1e1684c

Please sign in to comment.