-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevwork-versions
More file actions
executable file
·30 lines (26 loc) · 1.03 KB
/
devwork-versions
File metadata and controls
executable file
·30 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# devwork-versions - Display versions of all installed development tools
# Can be used as healthcheck or verification script
# Helper function to safely get version or return NOT FOUND
get_version() {
tool_name="$1"
version_cmd="$2"
if command -v "$(echo "$version_cmd" | awk '{print $1}')" >/dev/null 2>&1; then
version=$(eval "$version_cmd" 2>&1 | head -1 || echo "ERROR")
else
version="NOT FOUND"
fi
printf "%-12s %s\n" "$tool_name:" "$version"
}
# Display versions
get_version "bat" "batcat --version | awk '{print \$2}'"
get_version "opencode" "opencode --version"
get_version "eza" "eza --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1"
get_version "jq" "jq --version | sed 's/jq-//'"
get_version "node" "node --version"
get_version "npm" "npm --silent --version"
get_version "pnpm" "pnpm --version"
get_version "ripgrep" "rg --version | awk '{print \$2}'"
get_version "starship" "starship --version | awk '{print \$2}'"
get_version "uvx" "uvx --version"
get_version "zsh" "zsh --version | awk '{print \$2}'"