Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordrak authored Jul 24, 2019
2 parents 2dbd504 + b0c7717 commit cdeda11
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ Architecture other than the default amd64 can be specified with the `TFENV_ARCH`
TFENV_ARCH=arm tfenv install 0.7.9
```

### Customize remote

Installing from a remote other than the default https://releases.hashicorp.com can be done by specifying the `TFENV_REMOTE` environment varible

```console
TFENV_REMOTE=https://example.jfrog.io/artifactory/hashicorp
```

### tfenv use <version>
Switch a version to use

Expand Down
3 changes: 2 additions & 1 deletion libexec/tfenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ esac
keybase_bin="$(command -v keybase 2>/dev/null)"
shasum_bin="$(command -v shasum 2>/dev/null)"

version_url="https://releases.hashicorp.com/terraform/${version}"
TFENV_REMOTE="${TFENV_REMOTE:-https://releases.hashicorp.com}"
version_url="${TFENV_REMOTE}/terraform/${version}"

# Thanks for the inconsistency in 0.12-alpha, Hashicorp(!)
if [[ "${version}" =~ 0.12.0-alpha[3-9] ]]; then
Expand Down
3 changes: 2 additions & 1 deletion libexec/tfenv-list-remote
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if [ "${#}" -ne 0 ];then
exit 1
fi

curlw -sf "https://releases.hashicorp.com/terraform/" \
TFENV_REMOTE="${TFENV_REMOTE:-https://releases.hashicorp.com}"
curlw -sf "${TFENV_REMOTE}/terraform/" \
| grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha)[0-9]+)?" \
| uniq

0 comments on commit cdeda11

Please sign in to comment.