Skip to content

Commit

Permalink
also make _current link
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 12, 2026
1 parent a3df559 commit 7d91477
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion terraform/get-terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

ARG=$1
THIS=$(basename $0)
THIS_VERSION="1.0.14"
THIS_VERSION="1.1.0"

#VERSION="0.12.8"
#test -d terraform || mkdir terraform
Expand Down Expand Up @@ -93,3 +93,19 @@ then
umask 022
cp terraform_${version} $BINDIR/ && ln -sf terraform_${version} $BINDIR/terraform_latest
fi
if [[ $ARG == "install" ]]
then
tfbin=$(which terraform_current 2> /dev/null)
if [ ! -z $tfbin ]
then
BINDIR=$(dirname $tfbin)
elif [ -z $BINDIR ]
then
echo "x unable to locate current terraform binary, use BINDIR=path to install"
exit 1
fi

echo "* installing terraform $version into $BINDIR/terraform_current"
umask 022
cp terraform_${version} $BINDIR/ && ln -sf terraform_${version} $BINDIR/terraform_current
fi

0 comments on commit 7d91477

Please sign in to comment.