Skip to content

Commit b837e6f

Browse files
committed
🐛 fix prompt existence checks and path consistency in ralph.sh
1 parent a46c8bc commit b837e6f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/ralph.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,20 @@ for i in $(seq 1 $MAX_ITERATIONS); do
107107
exit 1
108108
fi
109109
elif [[ "$TOOL" == "amp" ]]; then
110-
OUTPUT=$(cat "$RALPH_DIR/prompt.md" | amp --dangerously-allow-all 2>&1 | tee /dev/stderr) || true
110+
if [ -f "$RALPH_DIR/prompt.md" ]; then
111+
OUTPUT=$(cat "$RALPH_DIR/prompt.md" | amp --dangerously-allow-all 2>&1 | tee /dev/stderr) || true
112+
else
113+
echo "Error: $RALPH_DIR/prompt.md not found. Create this file or use a different tool."
114+
exit 1
115+
fi
111116
else
112117
# Claude Code: use --dangerously-skip-permissions for autonomous operation, --print for output
113-
OUTPUT=$(claude --dangerously-skip-permissions --print < "$SCRIPT_DIR/../CLAUDE.md" 2>&1 | tee /dev/stderr) || true
118+
if [ -f "$RALPH_DIR/prompt.md" ]; then
119+
OUTPUT=$(claude --dangerously-skip-permissions --print < "$RALPH_DIR/prompt.md" 2>&1 | tee /dev/stderr) || true
120+
else
121+
echo "Error: $RALPH_DIR/prompt.md not found. Create this file or use a different tool."
122+
exit 1
123+
fi
114124
fi
115125

116126
# Check for completion signal

0 commit comments

Comments
 (0)