Skip to content

Commit

Permalink
Add support for netrc for private mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Parsons committed Jul 7, 2022
1 parent 7e89520 commit 4c3abe9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ e.g.
$ TFENV_TERRAFORM_VERSION=latest:^0.11. terraform --version
```

##### `TFENV_NETRC_PATH`

String (Default: "")

If not empty string, this variable specifies the credentials file used to access the remote location (useful if used in conjunction with TFENV_REMOTE).

e.g.

```console
$ TFENV_NETRC_PATH="$PWD/.netrc.tfenv"
```

#### Bashlog Logging Library

##### `BASHLOG_COLOURS`
Expand Down
8 changes: 7 additions & 1 deletion lib/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function curlw () {
TLS_OPT="";
fi;

curl ${TLS_OPT} "$@";
if [[ ! -z "${TFENV_NETRC_PATH:-""}" ]]; then
NETRC_OPT="--netrc-file ${TFENV_NETRC_PATH}";
else
NETRC_OPT="";
fi;

curl ${TLS_OPT} ${NETRC_OPT} "$@";
}
export -f curlw;

Expand Down

0 comments on commit 4c3abe9

Please sign in to comment.