diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-18 20:37:53 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-18 20:37:53 -0500 |
commit | c5d546a87d38ef07a7b98edba472c4599decd35f (patch) | |
tree | fb231dd24b02f71f79b3b9e9ed1e39b2f5f6dd6b | |
parent | 552ad1f926c18e537b0baddd557679fb80e183bc (diff) |
enable extra_info for standalone js_optimizer.py
-rw-r--r-- | tools/js_optimizer.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py index 50ae4f51..12e76223 100644 --- a/tools/js_optimizer.py +++ b/tools/js_optimizer.py @@ -371,5 +371,11 @@ def run(filename, passes, js_engine=shared.NODE_JS, jcache=False, source_map=Fal return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info)) if __name__ == '__main__': - run(sys.argv[1], sys.argv[2:]) + last = sys.argv[-1] + if '{' in last: + extra_info = json.loads(last) + sys.argv = sys.argv[:-1] + else: + extra_info = None + run(sys.argv[1], sys.argv[2:], extra_info=extra_info) |