Created
January 29, 2017 19:44
-
-
Save pH-7/eac87eeffbf8804006422520a67ca0ae to your computer and use it in GitHub Desktop.
Cleanup the indentation of your php, css, html, readme, and other files
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/bash | |
## | |
# Author: Pierre-Henry Soria <[email protected]> | |
# Copyright: (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved. | |
# License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. | |
## | |
accepted_ext="-name '*.php' -or -name '*.css' -or -name '*.js' -or -name '*.html' -or -name '*.xml' -or -name '*.xsl' -or -name '*.xslt' -or -name '*.json' -or -name '*.yml' -or -name '*.tpl' -or -name '*.phs' -or -name '*.ph7' -or -name '*.sh' -or -name '*.sql' -or -name '*.ini' -or -name '*.md' -or -name '*.markdown' -or -name '.htaccess'" | |
exec="find . -type f \( $accepted_ext \) -print0 | xargs -0 perl -wi -pe" | |
eval "$exec 's/\s+$/\n/'" | |
eval "$exec 's/\t/ /g'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment