#!/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_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