Skip to content

Commit 825370f

Browse files
committed
docs: refine README.md to clarify installation instructions and add troubleshooting tips for better user support
1 parent cc0c98e commit 825370f

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

scripts/test-debug.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
echo "🔍 Knowledge Debug Script"
4+
echo "========================="
5+
6+
# Verificar se o build funciona
7+
echo "1. Testing build..."
8+
bun run build
9+
if [ $? -eq 0 ]; then
10+
echo "✅ Build successful"
11+
else
12+
echo "❌ Build failed"
13+
exit 1
14+
fi
15+
16+
# Verificar se os arquivos foram gerados
17+
echo ""
18+
echo "2. Checking generated files..."
19+
if [ -f "dist/index.html" ]; then
20+
echo "✅ index.html generated"
21+
else
22+
echo "❌ index.html not found"
23+
fi
24+
25+
if [ -f "dist/assets/css/style.css" ]; then
26+
echo "✅ CSS files generated"
27+
else
28+
echo "❌ CSS files not found"
29+
fi
30+
31+
if [ -f "dist/assets/js/main.js" ]; then
32+
echo "✅ JS files generated"
33+
else
34+
echo "❌ JS files not found"
35+
fi
36+
37+
# Iniciar servidor em background
38+
echo ""
39+
echo "3. Starting server..."
40+
bun run serve --port 8082 &
41+
SERVER_PID=$!
42+
43+
# Aguardar servidor iniciar
44+
sleep 2
45+
46+
# Testar se servidor responde
47+
echo ""
48+
echo "4. Testing server response..."
49+
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8082)
50+
if [ "$HTTP_STATUS" = "200" ]; then
51+
echo "✅ Server responding (HTTP $HTTP_STATUS)"
52+
else
53+
echo "❌ Server not responding (HTTP $HTTP_STATUS)"
54+
fi
55+
56+
# Testar CSS
57+
echo ""
58+
echo "5. Testing CSS loading..."
59+
CSS_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8082/assets/css/style.css)
60+
if [ "$CSS_STATUS" = "200" ]; then
61+
echo "✅ CSS loading correctly (HTTP $CSS_STATUS)"
62+
else
63+
echo "❌ CSS not loading (HTTP $CSS_STATUS)"
64+
fi
65+
66+
# Mostrar primeiras linhas do HTML
67+
echo ""
68+
echo "6. HTML content preview:"
69+
echo "------------------------"
70+
curl -s http://localhost:8082 | head -20
71+
72+
echo ""
73+
echo "========================="
74+
echo "🌐 Server running at: http://localhost:8082"
75+
echo "📁 Files in dist/:"
76+
ls -la dist/ | head -10
77+
echo ""
78+
echo "🛑 To stop server: kill $SERVER_PID"
79+
echo "📖 Open http://localhost:8082 in your browser"

0 commit comments

Comments
 (0)