Skip to content

Instantly share code, notes, and snippets.

@tondrej
Last active April 25, 2017 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tondrej/9b460fb8be39eff5f252c9cc51ef6bdf to your computer and use it in GitHub Desktop.
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
#!/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