-
-
Save jvns/c7272cfb906e3ed0a3e9f8d361c5b5fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p diffs/missing | |
find public -type f | grep html | while read -r file; do | |
relative_path="${file#public/}" | |
old_file="public_old/$relative_path" | |
diff_file="diffs/$relative_path" | |
mkdir -p "$(dirname "$diff_file")" | |
if [ -f "$old_file" ]; then | |
# diff --color=always -B -w "$old_file" "$file" > "$diff_file" | |
git diff --color=always --color-words --word-diff-regex=[^[:space:]] --no-index "$old_file" "$file" > "$diff_file" | |
#git diff --word-diff-regex=[^[:space:]] --no-index "$old_file" "$file" > "$diff_file" | |
else | |
echo "File $relative_path does not exist in public_old" > "diffs/missing/$relative_path" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment