Skip to content

Instantly share code, notes, and snippets.

@eriknomitch
Last active February 18, 2018 23:13
Show Gist options
  • Save eriknomitch/9800c13234679bc8c13aec551cd80508 to your computer and use it in GitHub Desktop.
Save eriknomitch/9800c13234679bc8c13aec551cd80508 to your computer and use it in GitHub Desktop.
Displays version status of each installed asdf plugin
#!/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
print
done
@eriknomitch
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment