Created
October 4, 2017 07:14
-
-
Save tyxla/1685d1a60595ab6bd717abbafa3368e4 to your computer and use it in GitHub Desktop.
Remove empty lines between ES6 imports recursively in a directory (using multiline regex find and replace with perl)
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
find . -type f -exec perl -0777 -i -p -e 's/(import[^\n\r]+)[\n\r]{2,}(import[^\n\r]+)/\1\n\2/igs' {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're getting the "illegal byte sequence" error, you might want to type the following commands in your console first: