Skip to content

Instantly share code, notes, and snippets.

@amontalban
Created November 22, 2019 14:41
Show Gist options
  • Save amontalban/380c68b99491577cf042d9ee9560f395 to your computer and use it in GitHub Desktop.
Save amontalban/380c68b99491577cf042d9ee9560f395 to your computer and use it in GitHub Desktop.
Andres-Montalban:~ andres$ brew install tfenv
==> Downloading https://github.com/tfutils/tfenv/archive/v1.0.2.tar.gz
Already downloaded: /Users/andres/Library/Caches/Homebrew/downloads/57d000da62948b9bc641a5c4d5aeb1b82c7951025a1c6205baf0ffcc1c2cc5d3--tfenv-1.0.2.tar.gz
🍺 /usr/local/Cellar/tfenv/1.0.2: 20 files, 29.2KB, built in 4 seconds
Andres-Montalban:~ andres$ tfenv install latest
+ [tfenv:22] '[' -z '' ']'
++++ [tfenv:23] readlink_f /usr/local/bin/tfenv
++++ [tfenv:10] local target_file=/usr/local/bin/tfenv
++++ [tfenv:11] local file_name
++++ [tfenv:13] '[' /usr/local/bin/tfenv '!=' '' ']'
+++++ [tfenv:14] dirname /usr/local/bin/tfenv
++++ [tfenv:14] cd /usr/local/bin
+++++ [tfenv:15] basename /usr/local/bin/tfenv
++++ [tfenv:15] file_name=tfenv
+++++ [tfenv:16] readlink tfenv
++++ [tfenv:16] target_file=../Cellar/tfenv/1.0.2/bin/tfenv
++++ [tfenv:13] '[' ../Cellar/tfenv/1.0.2/bin/tfenv '!=' '' ']'
+++++ [tfenv:14] dirname ../Cellar/tfenv/1.0.2/bin/tfenv
++++ [tfenv:14] cd ../Cellar/tfenv/1.0.2/bin
+++++ [tfenv:15] basename ../Cellar/tfenv/1.0.2/bin/tfenv
++++ [tfenv:15] file_name=tfenv
+++++ [tfenv:16] readlink tfenv
++++ [tfenv:16] target_file=
++++ [tfenv:13] '[' '' '!=' '' ']'
+++++ [tfenv:19] pwd -P
++++ [tfenv:19] echo /usr/local/Cellar/tfenv/1.0.2/bin/tfenv
+++ [tfenv:23] dirname /usr/local/Cellar/tfenv/1.0.2/bin/tfenv
++ [tfenv:23] cd /usr/local/Cellar/tfenv/1.0.2/bin/..
++ [tfenv:23] pwd
+ [tfenv:23] TFENV_ROOT=/usr/local/Cellar/tfenv/1.0.2
+ [tfenv:27] export TFENV_ROOT
+ [tfenv:28] PATH='/usr/local/Cellar/tfenv/1.0.2/libexec:/Users/andres/.rvm/gems/ruby-2.5.1/bin:/Users/andres/.rvm/gems/ruby-2.5.1@global/bin:/Users/andres/.rvm/rubies/ruby-2.5.1/bin:/Users/andres/perl5/bin:/usr/local/heroku/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/opt/X11/bin:/Users/andres/.rvm/bin:/Users/andres/Library/Python/2.7/bin'
+ [tfenv:29] export PATH
+ [tfenv:30] export TFENV_DIR=/Users/andres
+ [tfenv:30] TFENV_DIR=/Users/andres
+ [tfenv:40] command=install
+ [tfenv:41] case "${command}" in
++ [tfenv:54] command -v tfenv-install
+ [tfenv:54] command_path=/usr/local/Cellar/tfenv/1.0.2/libexec/tfenv-install
+ [tfenv:55] '[' -z /usr/local/Cellar/tfenv/1.0.2/libexec/tfenv-install ']'
+ [tfenv:60] shift 1
+ [tfenv:61] exec /usr/local/Cellar/tfenv/1.0.2/libexec/tfenv-install latest
+ [tfenv-install:4] source /usr/local/Cellar/tfenv/1.0.2/libexec/helpers
+ [tfenv-install:6] '[' 1 -gt 1 ']'
+ [tfenv-install:8] declare version_requested version regex
+ [tfenv-install:10] '[' -z latest ']'
+ [tfenv-install:16] version_requested=latest
+ [tfenv-install:19] [[ latest =~ ^min-required$ ]]
+ [tfenv-install:31] [[ latest =~ ^latest:.*$ ]]
+ [tfenv-install:34] [[ latest =~ ^latest$ ]]
+ [tfenv-install:35] version=latest
+ [tfenv-install:36] regex='^[0-9]\+\.[0-9]\+\.[0-9]\+$'
+ [tfenv-install:42] '[' -n latest ']'
++ [tfenv-install:43] tfenv-list-remote
++ [tfenv-install:43] grep -e '^[0-9]\+\.[0-9]\+\.[0-9]\+$'
++ [tfenv-install:43] head -n 1
+ [tfenv-list-remote:4] source /usr/local/Cellar/tfenv/1.0.2/libexec/helpers
+ [tfenv-list-remote:6] '[' 0 -ne 0 ']'
+ [tfenv-list-remote:11] TFENV_REMOTE=https://releases.hashicorp.com
+ [tfenv-list-remote:12] curlw -sf https://releases.hashicorp.com/terraform/
+ [helpers:18] local TLS_OPT=--tlsv1.2
+ [tfenv-list-remote:13] grep -o -E '[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)[0-9]*)?'
+ [tfenv-list-remote:14] uniq
++ [helpers:21] command -v sw_vers
+ [helpers:21] [[ -n /usr/bin/sw_vers ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.12\.([6-9]|[0-9]{2}) ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.1[3-9] ]]
+ [helpers:22] TLS_OPT=
+ [helpers:25] curl -sf https://releases.hashicorp.com/terraform/
+ [tfenv-install:43] version=0.12.16
+ [tfenv-install:44] '[' -n 0.12.16 ']'
+ [tfenv-install:46] dst_path=/usr/local/Cellar/tfenv/1.0.2/versions/0.12.16
+ [tfenv-install:47] '[' -f /usr/local/Cellar/tfenv/1.0.2/versions/0.12.16/terraform ']'
+ [tfenv-install:52] TFENV_ARCH=amd64
+ [tfenv-install:53] case "$(uname -s)" in
++ [tfenv-install:53] uname -s
+ [tfenv-install:55] os=darwin_amd64
++ [tfenv-install:71] command -v keybase
+ [tfenv-install:71] keybase_bin=
++ [tfenv-install:72] command -v shasum
+ [tfenv-install:72] shasum_bin=/usr/local/bin/shasum
+ [tfenv-install:74] TFENV_REMOTE=https://releases.hashicorp.com
+ [tfenv-install:75] version_url=https://releases.hashicorp.com/terraform/0.12.16
+ [tfenv-install:78] [[ 0.12.16 =~ 0.12.0-alpha[3-9] ]]
+ [tfenv-install:81] tarball_name=terraform_0.12.16_darwin_amd64.zip
+ [tfenv-install:84] shasums_name=terraform_0.12.16_SHA256SUMS
+ [tfenv-install:86] info 'Installing Terraform v0.12.16'
+ [helpers:13] echo -e '\033[0;32m[INFO] Installing Terraform v0.12.16\033[0;39m'
[INFO] Installing Terraform v0.12.16
++ [tfenv-install:89] mktemp -d tfenv_download.XXXXXX
+ [tfenv-install:89] download_tmp=tfenv_download.XkywPP
+ [tfenv-install:91] trap 'rm -rf tfenv_download.XkywPP' EXIT
+ [tfenv-install:93] info 'Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_darwin_amd64.zip'
+ [helpers:13] echo -e '\033[0;32m[INFO] Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_darwin_amd64.zip\033[0;39m'
[INFO] Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_darwin_amd64.zip
+ [tfenv-install:94] curlw -# -f -o tfenv_download.XkywPP/terraform_0.12.16_darwin_amd64.zip https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_darwin_amd64.zip
+ [helpers:18] local TLS_OPT=--tlsv1.2
++ [helpers:21] command -v sw_vers
+ [helpers:21] [[ -n /usr/bin/sw_vers ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.12\.([6-9]|[0-9]{2}) ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.1[3-9] ]]
+ [helpers:22] TLS_OPT=
+ [helpers:25] curl -# -f -o tfenv_download.XkywPP/terraform_0.12.16_darwin_amd64.zip https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_darwin_amd64.zip
######################################################################## 100.0%
+ [tfenv-install:95] info 'Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_SHA256SUMS'
+ [helpers:13] echo -e '\033[0;32m[INFO] Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_SHA256SUMS\033[0;39m'
[INFO] Downloading SHA hash file from https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_SHA256SUMS
+ [tfenv-install:96] curlw -s -f -o tfenv_download.XkywPP/terraform_0.12.16_SHA256SUMS https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_SHA256SUMS
+ [helpers:18] local TLS_OPT=--tlsv1.2
++ [helpers:21] command -v sw_vers
+ [helpers:21] [[ -n /usr/bin/sw_vers ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.12\.([6-9]|[0-9]{2}) ]]
++ [helpers:21] sw_vers
+ [helpers:21] [[ ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95 =~ 10\.1[3-9] ]]
+ [helpers:22] TLS_OPT=
+ [helpers:25] curl -s -f -o tfenv_download.XkywPP/terraform_0.12.16_SHA256SUMS https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_SHA256SUMS
+ [tfenv-install:107] [[ -n '' ]]
+ [tfenv-install:124] [[ -f /usr/local/Cellar/tfenv/1.0.2/use-gnupg ]]
+ [tfenv-install:140] [[ -f /usr/local/Cellar/tfenv/1.0.2/use-gpgv ]]
+ [tfenv-install:164] warn_and_continue 'No keybase install found, skipping OpenPGP signature verification'
++ [helpers:9] basename /usr/local/Cellar/tfenv/1.0.2/libexec/tfenv-install
+ [helpers:9] echo -e 'tfenv: tfenv-install: \033[0;33m[WARN] No keybase install found, skipping OpenPGP signature verification\033[0;39m'
tfenv: tfenv-install: [WARN] No keybase install found, skipping OpenPGP signature verification
+ [tfenv-install:167] [[ -n /usr/local/bin/shasum ]]
+ [tfenv-install:167] [[ -x /usr/local/bin/shasum ]]
+ [tfenv-install:169] cd tfenv_download.XkywPP
+ [tfenv-install:171] /usr/local/bin/shasum -a 256 -s -c /dev/fd/63
++ [tfenv-install:171] grep -F terraform_0.12.16_darwin_amd64.zip terraform_0.12.16_SHA256SUMS
+ [tfenv-install:180] mkdir -p /usr/local/Cellar/tfenv/1.0.2/versions/0.12.16
+ [tfenv-install:181] unzip tfenv_download.XkywPP/terraform_0.12.16_darwin_amd64.zip -d /usr/local/Cellar/tfenv/1.0.2/versions/0.12.16
Archive: tfenv_download.XkywPP/terraform_0.12.16_darwin_amd64.zip
inflating: /usr/local/Cellar/tfenv/1.0.2/versions/0.12.16/terraform
+ [tfenv-install:183] info 'Installation of terraform v0.12.16 successful'
+ [helpers:13] echo -e '\033[0;32m[INFO] Installation of terraform v0.12.16 successful\033[0;39m'
[INFO] Installation of terraform v0.12.16 successful
+ [tfenv-install:184] tfenv-use 0.12.16
+ [tfenv-use:4] source /usr/local/Cellar/tfenv/1.0.2/libexec/helpers
+ [tfenv-use:6] '[' 1 -ne 1 ']'
+ [tfenv-use:8] declare version_requested version regex
+ [tfenv-use:10] version_requested=0.12.16
+ [tfenv-use:12] [[ 0.12.16 =~ ^min-required$ ]]
+ [tfenv-use:24] [[ 0.12.16 =~ ^latest:.*$ ]]
+ [tfenv-use:27] [[ 0.12.16 =~ ^latest$ ]]
+ [tfenv-use:31] version=0.12.16
+ [tfenv-use:32] regex='^0.12.16$'
+ [tfenv-use:35] '[' -d /usr/local/Cellar/tfenv/1.0.2/versions ']'
++ [tfenv-use:42] ls /usr/local/Cellar/tfenv/1.0.2/versions
++ [tfenv-use:42] sort -t. -k 1nr,1 -k 2nr,2 -k 3nr,3
++ [tfenv-use:42] grep -e '^0.12.16$'
++ [tfenv-use:42] head -n 1
+ [tfenv-use:42] version=
+ [tfenv-use:44] '[' -n '' ']'
+ [tfenv-use:44] error_and_die 'No installed versions of terraform matched '\''0.12.16'\'''
++ [helpers:4] basename /usr/local/Cellar/tfenv/1.0.2/libexec/tfenv-use
+ [helpers:4] echo -e 'tfenv: tfenv-use: \033[0;31m[ERROR] No installed versions of terraform matched '\''0.12.16'\''\033[0;39m'
tfenv: tfenv-use: [ERROR] No installed versions of terraform matched '0.12.16'
+ [helpers:5] exit 1
+ [tfenv-install:185] rm -rf tfenv_download.XkywPP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment