We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40b3f81 commit e0f1314Copy full SHA for e0f1314
1 file changed
scripts/fix-heredoc-install.sh
@@ -26,8 +26,10 @@ while IFS= read -r -d '' file; do
26
# Pattern 1: curl | bash / curl | sh (pipe-to-shell)
27
if grep -qP 'curl\s.*\|\s*(ba)?sh' "$file" 2>/dev/null; then
28
echo " FOUND curl|bash in $rel_path"
29
- # Add warning comment
30
- sed -i 's/\(.*curl.*|.*sh\)/# WARNING: Pipe-to-shell is unsafe — download and verify first\n\1/' "$file" 2>/dev/null || true
+ # Add warning comment (idempotent — skip if already annotated)
+ if ! grep -q "WARNING: Pipe-to-shell is unsafe" "$file" 2>/dev/null; then
31
+ sed -i 's/\(.*curl.*|.*sh\)/# WARNING: Pipe-to-shell is unsafe — download and verify first\n\1/' "$file" 2>/dev/null || true
32
+ fi
33
((changes++)) || true
34
fi
35
0 commit comments