diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-06 18:01:23 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-06 18:01:23 -0800 |
commit | f5d7160fb4672884717be1d3c4c5c5b070d5003e (patch) | |
tree | 4df7955f695a5f4ab66a9d80a4e89eb07e9dc5ea | |
parent | b2adfb09ae28da6f48fe117e518e3138dec6e983 (diff) |
remove trivial whitespace
-rwxr-xr-x | emcc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -75,7 +75,7 @@ emcc can be influenced by a few environment variables: EMMAKEN_COMPILER - The compiler to be used, if you don't want the default clang. ''' -import os, sys, shutil, tempfile, subprocess, shlex, time +import os, sys, shutil, tempfile, subprocess, shlex, time, re from subprocess import PIPE, STDOUT from tools import shared from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename @@ -1361,6 +1361,12 @@ try: flush_js_optimizer_queue() + if not minify_whitespace: + # Remove some trivial whitespace + src = open(final).read() + src = re.sub(r'\n+[ \n]*\n+', '\n', src) + open(final, 'w').write(src) + # If we were asked to also generate HTML, do that if final_suffix == 'html': if DEBUG: print >> sys.stderr, 'emcc: generating HTML' |