Created
October 28, 2013 15:23
-
-
Save tai2/7198772 to your computer and use it in GitHub Desktop.
replace CR -> LF in files to be commited
This file contains hidden or 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 | |
| # Redirect output to stderr. | |
| exec 1>&2 | |
| for file in `git status --porcelain | grep '^[AM] ' | sed 's/^...//'` | |
| do | |
| ext=${file##*.} | |
| if [ $ext = "as" ]; then | |
| cat $file | tr '\r' '\n' > $file".tmp" | |
| mv $file".tmp" $file | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment