forked from roger2ai/Claude-Code-Compiled
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfind_missing.sh
More file actions
35 lines (32 loc) · 1.12 KB
/
find_missing.sh
File metadata and controls
35 lines (32 loc) · 1.12 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
#!/bin/bash
# Iteratively find missing modules and report them
cd /home/roger/.openclaw/workspace/claude-code
export PATH="$HOME/.bun/bin:$PATH"
for i in $(seq 1 50); do
output=$(timeout 5 bun run src/main.tsx --help 2>&1)
if echo "$output" | grep -q "Cannot find module"; then
mod=$(echo "$output" | grep "Cannot find module" | sed "s/.*module '//;s/' from.*//")
file=$(echo "$output" | grep "Cannot find module" | sed "s/.*from '//;s/'$//")
echo "MISSING: $mod (imported from $file)"
# Check if it's a local file with wrong extension
dir=$(dirname "$file")
base=$(echo "$mod" | sed 's/\.js$//')
tsfile="$dir/$base.ts"
tsxfile="$dir/$base.tsx"
if [ -f "$tsfile" ]; then
echo " -> EXISTS as $tsfile (extension issue)"
elif [ -f "$tsxfile" ]; then
echo " -> EXISTS as $tsxfile (extension issue)"
else
echo " -> GENUINELY MISSING"
fi
elif echo "$output" | grep -q "error:"; then
err=$(echo "$output" | grep "error:" | head -1)
echo "OTHER ERROR: $err"
break
else
echo "SUCCESS (or different error)"
echo "$output" | head -5
break
fi
done