Files
infisical/frontend/scripts/replace-variable.sh
2022-12-05 21:17:59 +01:00

17 lines
391 B
Bash

#!/bin/sh
ORIGINAL=$1
REPLACEMENT=$2
if [ "${ORIGINAL}" = "${REPLACEMENT}" ]; then
echo "Replacement is the same, skipping.."
exit 0
fi
echo "Replacing pre-baked value.."
find /app/public /app/.next -type f ! -name "*.png" ! -name "*.svg" ! -name "*.gif" ! -name "*.jpg" ! -name "*.jpeg" ! -name "*.ico" |
while read file; do
sed -i "s|$ORIGINAL|$REPLACEMENT|g" "$file"
done