Fix research
This commit is contained in:
37
scripts/check_syntax.sh
Executable file
37
scripts/check_syntax.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# Godot Syntax Checker
|
||||
# Usage: ./scripts/check_syntax.sh <script_path>
|
||||
# Example: ./scripts/check_syntax.sh res://tests/test_gold_mine_click.gd
|
||||
|
||||
SCRIPT="$1"
|
||||
GODOT_BIN="${GODOT_BIN:-godot}"
|
||||
|
||||
if [ -z "$SCRIPT" ]; then
|
||||
echo "Usage: $0 <script_path>"
|
||||
echo "Example: $0 res://tests/test_gold_mine_click.gd"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$SCRIPT" ]; then
|
||||
echo "Error: Script not found: $SCRIPT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=========================================="
|
||||
echo "Checking syntax: $SCRIPT"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
"$GODOT_BIN" --headless --path . --check-only --script "$SCRIPT"
|
||||
EXIT_CODE=$?
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "✓ Syntax valid"
|
||||
else
|
||||
echo "✗ Syntax errors found"
|
||||
fi
|
||||
echo "=========================================="
|
||||
|
||||
exit $EXIT_CODE
|
||||
Reference in New Issue
Block a user