-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-claude.sh
More file actions
executable file
·55 lines (47 loc) · 1.58 KB
/
test-claude.sh
File metadata and controls
executable file
·55 lines (47 loc) · 1.58 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Test Claude Code installation
# Usage: test-claude.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "=== Testing Claude Code installation ==="
# Test 1: Check Node.js is installed and not EOL Node 18
echo ""
echo "--- Test 1: Check Node.js version ---"
if ! command -v node &> /dev/null; then
echo "FAIL: Node.js is not installed"
exit 1
fi
NODE_VERSION=$(node --version)
echo "Node.js: $NODE_VERSION"
NODE_MAJOR=$(echo "$NODE_VERSION" | sed 's/^v//' | cut -d. -f1)
if [ "$NODE_MAJOR" -le 18 ]; then
echo "FAIL: Node.js $NODE_VERSION is EOL (need >18)"
exit 1
fi
echo "npm: $(npm --version)"
echo "PASS: Node.js $NODE_VERSION is installed and not EOL"
# Test 2: Check if claude command is available
echo ""
echo "--- Test 2: Check Claude Code availability ---"
if command -v claude &> /dev/null; then
echo "Claude Code: $(which claude)"
echo "PASS: Claude Code is installed"
else
echo "WARN: Claude Code not found"
echo "This is expected if running outside the devcontainer"
echo "Claude Code is installed via DevContainer Feature"
exit 0
fi
# Test 3: Check Claude Code version
echo ""
echo "--- Test 3: Check Claude Code version ---"
VERSION=$(claude --version 2>&1 || echo "version command not available")
echo "Version: $VERSION"
echo "PASS: Claude Code version check completed"
# Test 4: Check Claude Code help
echo ""
echo "--- Test 4: Check Claude Code help ---"
claude --help > /dev/null 2>&1 || { echo "WARN: claude --help failed"; }
echo "PASS: Claude Code help works"
echo ""
echo "=== Claude Code tests completed ==="