Skip to content

Commit

Permalink
Fix '--version' flag when not running from git checkout.
Browse files Browse the repository at this point in the history
The version of tfenv itself was hardcoded. When not running from
a git checkout this needs to be manually updated. Instead, it now
looks at the Changelog to find the latest released version of its
running TFENV_ROOT.
  • Loading branch information
onnos committed Jun 12, 2019
1 parent 6749958 commit bc41613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1 (unreleased)

* Fix '--version' flag to return version from CHANGELOG.md when not running from a git checkout.

## 1.0.0 (June 9, 2019)

* A number of bugfixes and basic script improvements
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv---version
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set -e
[ -n "${TFENV_DEBUG}" ] && set -x

version="0.6.0"
version=$(awk '/^##/{ print $2; exit}' "${TFENV_ROOT}"/CHANGELOG.md)
git_revision=""

if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q tfenv; then
Expand Down

0 comments on commit bc41613

Please sign in to comment.