Skip to content

Instantly share code, notes, and snippets.

@timdp
Created May 23, 2022 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timdp/6de5a1808261ede981104142b3904cef to your computer and use it in GitHub Desktop.
Save timdp/6de5a1808261ede981104142b3904cef to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
BOLD=$(tput bold)
DIM=$(tput dim)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
pr() {
printf '%s%-16s %-8s %s%s\n' "$@" "$RESET"
}
pr "$BOLD" Tool Current Latest
cat .tool-versions | sort | while read name version; do
versions=$(asdf list all "$name" | grep -E '^[0-9]')
latest=$(tail -1 <<<"$versions")
[[ $version == $latest ]] && color=$DIM || color=$YELLOW
pr "$color" "$name" "$version" "$latest"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment