git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/.bash
diff options
context:
space:
mode:
Diffstat (limited to '.bash')
-rw-r--r--.bash/aliases.bash55
-rw-r--r--.bash/postexec.bash2
2 files changed, 57 insertions, 0 deletions
diff --git a/.bash/aliases.bash b/.bash/aliases.bash
index 76fb793..42e1639 100644
--- a/.bash/aliases.bash
+++ b/.bash/aliases.bash
@@ -301,6 +301,61 @@ function update-user-extensions {
printf '%b/usr/bin/cargo not found, not updating Rust user installations.%b\n' "$mywarn" "$myrset"
fi
}
+# Display developer environment base versions.
+function list-env-versions {
+ hline
+ printf 'Versions:\n'
+ (
+ printf 'Bash;%b\n' "$BASH_VERSION"
+ if [ -r '/opt/puppetlabs/puppet/VERSION' ]; then
+ printf 'Puppet;%b\n' "$(cat /opt/puppetlabs/puppet/VERSION)"
+ fi
+ ruver="$(ruby -e 'print(RUBY_VERSION)' 2>/dev/null)"
+ rsver="$(/usr/bin/ruby -e 'print(RUBY_VERSION)' 2>/dev/null)"
+ if [ "$ruver" != "$rsver" ]; then
+ printf 'Ruby;%b (System: %b)\n' "$ruver" "$rsver"
+ else
+ printf 'Ruby;%b\n' "$rsver"
+ fi
+ # This is a mere string but in this case this is exactly what we want
+ puver="$(python -c 'from platform import python_version;print(python_version())' 2>/dev/null)"
+ psver="$(/usr/bin/python -c 'from platform import python_version;print(python_version())' 2>/dev/null)"
+ if [ -n "$puver" ] || [ -n "$psver" ]; then
+ if [ "$puver" != "$psver" ]; then
+ printf 'Python;%b (System: %b)\n' "$puver" "$psver"
+ else
+ printf 'Python;%b\n' "$psver"
+ fi
+ fi
+ huver="$(ghci --version 2>/dev/null | awk '{print $NF}')"
+ hsver="$(/usr/bin/ghci --version 2>/dev/null | awk '{print $NF}')"
+ cuver="$(cabal --version 2>/dev/null | awk '{print $NF}')"
+ csver="$(/usr/bin/cabal --version 2>/dev/null | awk '{print $NF}')"
+ stver="$(stack --version 2>/dev/null | head -n1)"
+ if [ -n "$stver" ]; then
+ shver="$(stack ghc -- --version 2>/dev/null | awk '{print $NF}')"
+ fi
+ printf 'Haskell\n'
+ if [ -n "$huver" ] || [ -n "$hsver" ]; then
+ if [ "$huver" != "$hsver" ]; then
+ printf ';GHCI:\t%b (System: %b)\n' "$huver" "$hsver"
+ else
+ printf ';GHCI:\t%b\n' "$psver"
+ fi
+ fi
+ if [ -n "$cuver" ] || [ -n "$csver" ]; then
+ if [ "$cuver" != "$csver" ]; then
+ printf ';Cabal:\t%b (System: %b)\n' "$cuver" "$csver"
+ else
+ printf ';Cabal:\t%b\n' "$psver"
+ fi
+ fi
+ if [ -n "$stver" ]; then
+ printf ';Stack:\t%b, GHC: %b\n' "$stver" "$shver"
+ fi
+ ) | column -ts';' | sed 's/^/\t/'
+ hline
+}
# ----- OTHER STUFF ----- #
for cmmd in batcat bat; do
if command -v "$cmmd" > /dev/null; then
diff --git a/.bash/postexec.bash b/.bash/postexec.bash
index 8beee31..0eafd2b 100644
--- a/.bash/postexec.bash
+++ b/.bash/postexec.bash
@@ -22,3 +22,5 @@ for gitpsrc in "/usr/share/git/git-prompt.sh" "/usr/local/share/git/git-prompt.s
break
fi
done
+
+list-env-versions