refactor: use error function for missing tool detection

- Add `error` helper to print red-colored error messages
- Replace hardcoded "not found" strings with `error` calls
- Add checks for uv, pipx, nodejs, pnpm, and mise
This commit is contained in:
2026-03-26 10:40:59 +08:00
parent 81ed765f9c
commit 38a7b74872

15
,
View File

@@ -11,8 +11,17 @@ echo "PATH:" $(echo "$PATH" | tr ':' '\n' | wc -l) "paths [Please run ',path' to
echo "" echo ""
echo "Ruby:" $(command -v ruby || echo "not found") error() {
echo "Python:" $(command -v python || echo "not found") echo -e "\033[31m$1\033[0m"
}
echo "llm:" $(command -v llm || echo "not found") echo "Ruby:" $(command -v ruby || error "not found")
echo "Python:" $(command -v python || error "not found")
echo "uv:" $(command -v uv || error "not found")
echo "pipx:" $(command -v pipx || error "not found")
echo "nodejs:": $(command -v node || error "not found")
echo "pnpm:" $(command -v pnpm || error "not found")
echo "mise:" $(command -v mise || error "not found")
echo "llm:" $(command -v llm || error "not found")