Skip to content

Instantly share code, notes, and snippets.

@Ry4an
Forked from anonymous/gist:2715319
Created May 17, 2012 02:28
Show Gist options
  • Save Ry4an/2715764 to your computer and use it in GitHub Desktop.
Save Ry4an/2715764 to your computer and use it in GitHub Desktop.
#!/bin/bash
THIS_FOLDER=`dirname $0`
node=$1
# What files have changed
files=`hg log --template="{files}" -r $node`
# Check each
for file in $files; do
type=`hg cat -r tip $file | file -b -`
if [[ "$type" =~ "text, with CRLF line terminators" ]]; then
echo "INFO: $file is $type"
echo "ERROR: $file is not ascii text with unix line ends"
exit 1;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment