Created
May 23, 2022 10:15
-
-
Save timdp/6de5a1808261ede981104142b3904cef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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