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

Commit

Permalink
Issue #52 delete src directory before untarring to prevent masking er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
nickg committed Mar 12, 2018
1 parent 7a51bfb commit 84f2b75
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 20 deletions.
5 changes: 2 additions & 3 deletions samples/godownloader-event-gateway.sh
Expand Up @@ -43,13 +43,12 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "event-gateway" ; do
if [ "$OS" = "windows" ]; then
Expand Down
6 changes: 3 additions & 3 deletions samples/godownloader-gometalinter.sh
Expand Up @@ -43,13 +43,13 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}/${NAME}"
rm -rf "${srcdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "gometalinter" "gocyclo" "nakedret" "misspell" "govet" "gas" "golint" "ineffassign" "goconst" "errcheck" "maligned" "unconvert" "dupl" "structcheck" "varcheck" "safesql" "deadcode" "lll" "goimports" "gotype" "gosimple" "megacheck" "staticcheck" "unused" "interfacer" "unparam" ; do
if [ "$OS" = "windows" ]; then
Expand Down
5 changes: 2 additions & 3 deletions samples/godownloader-goreleaser.sh
Expand Up @@ -43,13 +43,12 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "goreleaser" ; do
if [ "$OS" = "windows" ]; then
Expand Down
5 changes: 2 additions & 3 deletions samples/godownloader-hugo.sh
Expand Up @@ -43,13 +43,12 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "hugo" ; do
if [ "$OS" = "windows" ]; then
Expand Down
5 changes: 2 additions & 3 deletions samples/godownloader-minify.sh
Expand Up @@ -43,13 +43,12 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "minify" ; do
if [ "$OS" = "windows" ]; then
Expand Down
5 changes: 2 additions & 3 deletions samples/godownloader-misspell.sh
Expand Up @@ -43,13 +43,12 @@ parse_args() {
# out preventing half-done work
execute() {
tmpdir=$(mktmpdir)
log_debug "will download files to ${tmpdir}"
log_debug "downloading files into ${tmpdir}"
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"

(cd "${tmpdir}" && untar "${TARBALL}")
srcdir="${tmpdir}"
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in "misspell" ; do
if [ "$OS" = "windows" ]; then
Expand Down
4 changes: 2 additions & 2 deletions shell_godownloader.go
Expand Up @@ -74,13 +74,13 @@ execute() {
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}"
hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}"
(cd "${tmpdir}" && untar "${TARBALL}")
{{- if .Archive.WrapInDirectory }}
srcdir="${tmpdir}/${NAME}"
rm -rf "${srcdir}"
{{- else }}
srcdir="${tmpdir}"
{{- end }}
(cd "${tmpdir}" && untar "${TARBALL}")
install -d "${BINDIR}"
for binexe in {{ range .Builds }}"{{ .Binary }}" {{ end }}; do
if [ "$OS" = "windows" ]; then
Expand Down

0 comments on commit 84f2b75

Please sign in to comment.