Last active
April 25, 2017 17:41
-
-
Save tondrej/9b460fb8be39eff5f252c9cc51ef6bdf to your computer and use it in GitHub Desktop.
Git pre-commit hook to convert Delphi's *.dfm files from binary to text
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/sh | |
# Check *.dfm files being committed for binary format, if so convert to text automatically. | |
for s in $(git diff --cached --name-only *.dfm); do | |
grep -qI '' $s | |
if [ $? = 1 ]; then | |
echo Converting $s from binary to text | |
convert -i -t $s > /dev/null | |
git add $s | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment