Skip to content

Commit

Permalink
Only find CRLF not CR
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Dec 13, 2016
1 parent 1025c44 commit 3ca1830
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/file-crlf
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ DEFAULT_CUST_OPS=""
# __CUSTOM_OPT_PLACEHOLDER__
# This will be replaced either with custom options
# or with the default options.
MY_REG="CRLF"
MY_CHECK="file \"\$1\" | grep --color=always \"${MY_REG}\" || true"
MY_REG="[[:space:]]CRLF[[:space:]].*line"
MY_CHECK="file \"\$1\" | grep --color=always -E \"${MY_REG}\" || true"

# Can this check fix the problems?
ENABLE_FIX=1

MY_FIX_CMD="file \"\$1\" | grep -q \"${MY_REG}\" && (dos2unix -k -q -s \"\$1\" && echo \"Fixing: \$1\" || echo \"FAILED: \$1\") || true"
MY_FIX_CMD="file \"\$1\" | grep -qE \"${MY_REG}\" && (dos2unix -k -q -s \"\$1\" && echo \"Fixing: \$1\" || echo \"FAILED: \$1\") || true"

# Command to be displayed for --info
MY_INFO="file -v 2>&1 | grep -E '(([0-9]+)(\.))+'"
Expand Down

0 comments on commit 3ca1830

Please sign in to comment.