Skip to content

Commit

Permalink
Merge branch 'master' into remove-versions-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordrak authored May 27, 2020
2 parents 16e2a56 + df3a01a commit 1b2dce1
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.0.0 (Unreleased)
## 2.0.0 (April 20, 2020)

* New logging and debugging library
* Massive testing, logging and loading refactoring
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv---version
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-exec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
13 changes: 12 additions & 1 deletion libexec/tfenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down Expand Up @@ -95,13 +95,17 @@ case "$(uname -s)" in
CYGWIN_NT*)
os="windows_${TFENV_ARCH}";
;;
FreeBSD*)
os="freebsd_${TFENV_ARCH}"
;;
*)
os="linux_${TFENV_ARCH}";
;;
esac;

keybase_bin="$(command -v keybase 2>/dev/null)";
shasum_bin="$(command -v shasum 2>/dev/null)";
sha256sum_bin="$(command -v sha256sum 2>/dev/null)";

TFENV_REMOTE="${TFENV_REMOTE:-https://releases.hashicorp.com}";
version_url="${TFENV_REMOTE}/terraform/${version}";
Expand Down Expand Up @@ -226,6 +230,13 @@ if [[ -n "${shasum_bin}" && -x "${shasum_bin}" ]]; then
-c <(grep -F "${tarball_name}" "${shasums_name}") \
|| log 'error' 'SHA256 hash does not match!';
);
elif [[ -n "${sha256sum_bin}" && -x "${sha256sum_bin}" ]]; then
(
cd "${download_tmp}";
"${sha256sum_bin}" \
-c <(grep -F "${tarball_name}" "${shasums_name}") \
|| log 'error' 'SHA256 hash does not match!';
);
else
# Lack of shasum deserves a proper warning
log 'warn' 'No shasum tool available. Skipping SHA256 hash validation';
Expand Down
4 changes: 2 additions & 2 deletions libexec/tfenv-list
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down Expand Up @@ -73,7 +73,7 @@ version_name="$(tfenv-version-name)" \
|| log 'error' "tfenv-version-name failed";
export version_name;

export version_file="$(tfenv-version-file)" \
version_file="$(tfenv-version-file)" \
&& log 'debug' "tfenv-version-file reported: ${version_file}" \
|| log 'error' "tfenv-version-file failed";
export version_file;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-list-remote
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-min-required
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-resolve-version
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-use
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-version-file
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-version-name
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ -z "${TFENV_ROOT:-""}" ]; then
};

TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
[ -n ${TFENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
[ -n "${TFENV_ROOT}" ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine TFENV_ROOT";
else
TFENV_ROOT="${TFENV_ROOT%/}";
fi;
Expand Down

0 comments on commit 1b2dce1

Please sign in to comment.