15 lines
408 B
Bash
15 lines
408 B
Bash
#!/bin/sh
|
|
|
|
# Preprocess JavaScript files to handle PHP code as placeholders
|
|
for FILE in "$@"; do
|
|
TEMP_FILE=$(mktemp)
|
|
|
|
# Replace PHP code blocks with placeholders
|
|
sed -E 's/<?php(.*?)(\?>|$)/__PHP_BLOCK_START__\1__PHP_BLOCK_END__/g' "$FILE" > "$TEMP_FILE"
|
|
|
|
# Handle short PHP tags
|
|
sed -E 's/<?(.*?)(\?>|$)/__PHP_BLOCK_START__\1__PHP_BLOCK_END__/g' "$TEMP_FILE" > "$FILE"
|
|
|
|
rm "$TEMP_FILE"
|
|
done
|