Last active
May 17, 2020 17:39
-
-
Save tknhs/78fead338f4e2503038e18830663ae5e to your computer and use it in GitHub Desktop.
拡張子.mqh がバイナリファイルとして扱われることを防ぐために .git/hooks/pre-commit でコミットしていいかチェックする
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 | |
ok=true | |
for file in $(git diff --name-only --cached | grep .mqh); do | |
if [ "`nkf --guess $file | grep 'Shift_JIS'`" ]; then | |
: | |
else | |
ok=false | |
echo "$file is not Shift_JIS" | |
fi | |
done | |
if [ !$ok ]; then | |
echo "execute: nkf -s --overwrite *.mqh" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment