Skip to content

Commit

Permalink
Logging (tfutils#154)
Browse files Browse the repository at this point in the history
* Add all ubuntu options to travis

* Workaround bash 4.3 bug by replacing BASH_SOURCE with dirname $0

* Remove unsupported ubuntu release from travis
  • Loading branch information
Zordrak authored Nov 25, 2019
1 parent 45da04a commit dd2eced
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ matrix:
include:
- os: linux
dist: bionic
- os: linux
dist: xenial
- os: linux
dist: trusty
- os: osx
osx_image: xcode11.2
- os: osx
Expand Down
9 changes: 5 additions & 4 deletions libexec/tfenv---version
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ fi;

log 'debug' 'Scraping tfenv version from CHANGELOG.md';
version="$(awk '/^##/{ print $2; exit}' "${TFENV_ROOT}/CHANGELOG.md")" \
&& log 'debug' "Found version '${version}' in CHANGELOG.md" \
|| log 'error' 'Failed to scrape version from CHANGELOG.md';
git_revision="";

if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q tfenv; then
log 'debug' 'Getting git revision...';
git_revision="";
if cd "$(dirname ${0})" 2>/dev/null && git remote -v 2>/dev/null | grep -q tfenv; then
log 'debug' 'Git configuration found. Overriding CHANGELOG version from git revision...';
git_revision="$(git describe --tags HEAD 2>/dev/null || true)";
log 'debug' "Stripping git revision string ${git_revision}";
log 'debug' "Stripping git revision string from ${git_revision}";
git_revision="${git_revision#v}";
fi;

Expand Down

0 comments on commit dd2eced

Please sign in to comment.