Skip to content

Commit d514c18

Browse files
author
Admin
committed
- Corrected formatting errors, and renamed functions
1 parent d11feae commit d514c18

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Usage:
5454
--rsh <bin>
5555
Specifies the remote shell for remote installation. Defaults to ssh.
5656
57-
--install-terraform
57+
--with-terraform
5858
Installs Terraform binary from https://releases.hashicorp.com/terraform/1.3.4/ source
5959
alongside coder.
6060
This is great for if you are having issues with Coder installing terraform, or if you
@@ -221,7 +221,7 @@ main() {
221221
usage
222222
exit 0
223223
;;
224-
--install-terraform)
224+
--with-terraform)
225225
METHOD=install_terraform
226226
;;
227227
--)
@@ -270,7 +270,7 @@ main() {
270270
# result in a broken coder.
271271
OS=${OS:-$(os)}
272272
ARCH=${ARCH:-$(arch)}
273-
TERRA_ARCH=${TERRA_ARCH:-$(terra_arch)}
273+
TERRAFORM_ARCH=${TERRAFORM_ARCH:-$(terraform_arch)}
274274

275275
distro_name
276276

@@ -377,13 +377,13 @@ install_terraform() {
377377
echoerr "Please install unzip to use this function"
378378
exit 1
379379
fi
380-
381-
echoh "Installing Terraform version 1.3.4 $TERRA_ARCH package from Hashicorp Source."
380+
TERRAFORM_VERSION="1.3.4"
381+
echoh "Installing Terraform version $TERRAFORM_VERSION $TERRAFORM_ARCH package from Hashicorp Source."
382382
echoh
383383

384384
# Download from offical source and save it to cache
385-
fetch "https://releases.hashicorp.com/terraform/1.3.4/terraform_1.3.4_${OS}_${TERRA_ARCH}.zip" \
386-
"$CACHE_DIR/terraform_1.3.4_${OS}_${TERRA_ARCH}.zip"
385+
fetch "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_1.3.4_${OS}_${TERRAFORM_ARCH}.zip" \
386+
"$CACHE_DIR/terraform_${TERRAFORM_VERSION}_${OS}_${TERRAFORM_ARCH}.zip"
387387

388388
sh_c mkdir -p "$TERRAFORM_INSTALL_PREFIX" 2>/dev/null || true
389389

@@ -580,7 +580,7 @@ arch() {
580580

581581
# The following is to change the naming, that way people with armv7 won't recieve a error
582582
# List of binaries can be found here: https://releases.hashicorp.com/terraform/1.3.4/
583-
terra_arch() {
583+
terraform_arch() {
584584
uname_m=$(uname -m)
585585
case $uname_m in
586586
aarch64) echo arm64 ;;

0 commit comments

Comments
 (0)