This commit is contained in:
Alon Zakai 2013-03-06 18:01:23 -08:00
Родитель b2adfb09ae
Коммит f5d7160fb4
1 изменённых файлов: 7 добавлений и 1 удалений

8
emcc
Просмотреть файл

@ -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'