Add color replacement script

This commit is contained in:
2024-07-23 15:33:48 +03:00
parent 00eabc8150
commit 99f71070ed

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Check if both arguments are provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <old_color> <new_color>"
echo "Example: $0 556ee6 2A9D8F"
exit 1
fi
old_color=$1
new_color=$2
# Find all .html, .css, and .js files and replace the color
find . -type f \( -name "*.html" -o -name "*.css" -o -name "*.js" \) -print0 | xargs -0 sed -i "s/$old_color/$new_color/g"
echo "Color replacement complete: $old_color replaced with $new_color"