remove trivial whitespace
This commit is contained in:
Родитель
b2adfb09ae
Коммит
f5d7160fb4
8
emcc
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'
|
||||
|
|
Загрузка…
Ссылка в новой задаче