#!/bin/bash # patch-html.sh - Inject Hebrew RTL + translation into Paperclip UI set -e # Find the ui-dist directory in the global npm install UI_DIR=$(find /usr/local/lib/node_modules/paperclipai -name "ui-dist" -type d | head -1) if [ -z "$UI_DIR" ]; then echo "ERROR: Could not find Paperclip ui-dist directory" exit 1 fi echo "Found ui-dist at: $UI_DIR" # Copy assets cp /tmp/rtl-override.css "$UI_DIR/assets/rtl-override.css" cp /tmp/translate-he.js "$UI_DIR/assets/translate-he.js" # Patch index.html: # 1. Set dir="rtl" and lang="he" sed -i 's/ sed -i 's||\n\n|' "$UI_DIR/index.html" # 3. Update page title sed -i 's|Paperclip|Paperclip - פייפרקליפ|' "$UI_DIR/index.html" echo "Hebrew RTL patch applied successfully" echo "Patched files:" echo " - $UI_DIR/index.html" echo " - $UI_DIR/assets/rtl-override.css" echo " - $UI_DIR/assets/translate-he.js"