Skip to content

Instantly share code, notes, and snippets.

@MundakaZgz
Created November 7, 2023 10:59
Show Gist options
  • Save MundakaZgz/d0c6afecbc6f5704a16679b3f252260c to your computer and use it in GitHub Desktop.
Save MundakaZgz/d0c6afecbc6f5704a16679b3f252260c to your computer and use it in GitHub Desktop.
Show tooling version active
# Show tool versions
echo "--- Tooling Versions ---"
if command -v node > /dev/null 2>&1; then
echo "Node version: $(node --version)"
fi
if command -v npm > /dev/null 2>&1; then
echo "NPM version: $(npm --version)"
fi
if command -v yarn > /dev/null 2>&1; then
echo "Yarn version: $(yarn --version)"
fi
if command -v java > /dev/null 2>&1; then
echo "Java version: $(java -version 2>&1 | awk -F '"' '/version/ {print $2}')"
fi
if command -v mvn > /dev/null 2>&1; then
echo "Maven version: $(mvn --version 2>&1 | awk -F ' ' '/Apache/ {print $3}')"
fi
if command -v gradle > /dev/null 2>&1; then
echo "Gradle version: $(gradle --version 2>&1 | awk -F ' ' '/Gradle/ {print $2}')"
fi
if command -v docker > /dev/null 2>&1; then
echo "Docker version: $(docker --version | awk -F ' ' '/version/ {print $3}')"
fi
if command -v docker-compose > /dev/null 2>&1; then
echo "Docker Compose version: $(docker-compose --version | awk -F ' ' '/version/ {print $4}')"
fi
if command -v kubectl > /dev/null 2>&1; then
echo "Kubectl version: $(kubectl version --client=true | awk -F ' ' '/Client/ {print $3}')"
fi
if command -v helm > /dev/null 2>&1; then
echo "Helm version: $(helm version --short | awk -F ' ' '/v/ {print $2}')"
fi
if command -v python > /dev/null 2>&1; then
echo "Python version: $(python --version)"
fi
echo "------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment