diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-12-09 21:30:09 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-02-26 18:06:02 -0500 |
commit | 8e3d106320a2471a2dc3d694984d6a73cf5074e4 (patch) | |
tree | cea8f7e0c344ac29dd968b28c7bedf4276622372 | |
parent | 76d4703561145d18e609b3e206a6a661ba553724 (diff) | |
download | mongo-8e3d106320a2471a2dc3d694984d6a73cf5074e4.tar.gz |
strip comments from javascript
-rw-r--r-- | SConstruct | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct index b860995f06b..8499f0b7cb3 100644 --- a/SConstruct +++ b/SConstruct @@ -843,6 +843,8 @@ def concatjs(target, source, env): fullSource = "" + first = True + for s in source: f = open( str(s) , 'r' ) for l in f: @@ -850,8 +852,21 @@ def concatjs(target, source, env): if len ( l ) == 0: continue - fullSource += l + "\n" + if l == "}": + fullSource += "}" + continue + + if first: + first = False + else: + fullSource += "\n" + + fullSource += l + + fullSource += "\n" + fullSource = re.compile( r'/\*\*.*?\*/' , re.M | re.S ).sub( "" , fullSource ) + out = open( outFile , 'w' ) out.write( fullSource ) |