Last active
April 14, 2018 17:55
-
-
Save rbreaves/ff2d93602e0758c8f9297786855477b8 to your computer and use it in GitHub Desktop.
Fix improper Coldfusion Code Conventions with Perl
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 | |
# Run script in the root directory of the site | |
#Fix tag based functions that have eol and tabs in the tag | |
find . -name '*.cf*' -not -name '*.json' | xargs perl -i -0pe 's/(?:\G|\<cf)(?:(?!\>).)*\K\n\t+/ /g' | |
#Fix script based functions that also have eol and tabs | |
find . -name '*.cf*' -not -name '*.json' | xargs perl -i -0pe 's/(?:\G(?!\A)|\tpublic|\tremote|\tprivate)(?:(?!\)).)*?\K\n\t+/ /g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment