Last active
February 18, 2018 23:13
-
-
Save eriknomitch/9800c13234679bc8c13aec551cd80508 to your computer and use it in GitHub Desktop.
Displays version status of each installed asdf plugin
This file contains 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/zsh | |
autoload colors | |
colors | |
for _plugin in `asdf plugin-list`; do | |
# Header | |
# ---------------------------------------------- | |
print $fg_bold[green] ">" $fg_bold[white] $_plugin$reset_color | |
# Determine versions | |
# ---------------------------------------------- | |
# Send errors to dev null for 'No versions installed'. | |
_version_installed=`asdf list $_plugin 2>/dev/null || echo "<none>"` | |
_version_latest=`asdf list-all $_plugin | tail -n 1 | tr -d '\n'` | |
# Display | |
# ---------------------------------------------- | |
_color=$([ $_version_installed = $_version_latest ] && echo "green" || echo "yellow") | |
print " installed: " $fg_bold[$_color]$_version_installed$reset_color | |
print " latest: " $_version_latest | |
done |
Author
eriknomitch
commented
Feb 18, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment