Skip to content

Commit

Permalink
1.3.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed Aug 29, 2018
1 parent f62b1b9 commit 5ae25bd
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions terraform-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# sudoInstall=true

scriptname=$(basename "$0")
scriptbuildnum="1.3.1"
scriptbuildnum="1.3.2"
scriptbuilddate="2018-08-28"


Expand Down Expand Up @@ -120,8 +120,6 @@ fi
# DETERMINE DESTINATION
if [[ "$cwdInstall" ]]; then
BINDIR=$(pwd)
CMDPREFIX=""
STREAMLINED=true
elif [[ -w "/usr/local/bin" ]]; then
BINDIR="/usr/local/bin"
CMDPREFIX=""
Expand All @@ -147,13 +145,15 @@ else
fi
fi

# CREATE TMPDIR FOR EXTRACTION
TMPDIR=${TMPDIR:-/tmp}
UTILTMPDIR="terraform_${VERSION}"
if [[ ! "$cwdInstall" ]]; then
# CREATE TMPDIR FOR EXTRACTION
TMPDIR=${TMPDIR:-/tmp}
UTILTMPDIR="terraform_${VERSION}"

cd "$TMPDIR" || exit 1
mkdir -p "$UTILTMPDIR"
cd "$UTILTMPDIR" || exit 1
cd "$TMPDIR" || exit 1
mkdir -p "$UTILTMPDIR"
cd "$UTILTMPDIR" || exit 1
fi

# DOWNLOAD AND EXTRACT
case "${nettool}" in
Expand All @@ -164,14 +164,17 @@ case "${nettool}" in
esac
unzip -qq "$FILENAME" || exit 1

# COPY TO DESTINATION
mkdir -p "${BINDIR}" || exit 1
${CMDPREFIX} cp -f terraform "$BINDIR" || exit 1

# CLEANUP AND EXIT
cd "${TMPDIR}" || exit 1
rm -rf "${UTILTMPDIR}"
[[ ! "$STREAMLINED" ]] && echo
echo "Terraform Version ${VERSION} installed to ${BINDIR}"
if [[ ! "$cwdInstall" ]]; then
# COPY TO DESTINATION
mkdir -p "${BINDIR}" || exit 1
${CMDPREFIX} cp -f terraform "$BINDIR" || exit 1
# CLEANUP AND EXIT
cd "${TMPDIR}" || exit 1
rm -rf "${UTILTMPDIR}"
[[ ! "$STREAMLINED" ]] && echo
echo "Terraform Version ${VERSION} installed to ${BINDIR}"
else
echo "Terraform Version ${VERSION} downloaded"
fi

exit 0

0 comments on commit 5ae25bd

Please sign in to comment.