Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: third_party/closure_compiler/js_minify.py

Issue 2438293002: Don't assume python is in /usr/bin in js_minify.py (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 ''' Javascript minifier using the closure compiler 5 ''' Javascript minifier using the closure compiler
6 6
7 This minifier strips spaces and comments out of Javascript using the closure 7 This minifier strips spaces and comments out of Javascript using the closure
8 compiler. It takes the original Javascript on standard input, and outputs 8 compiler. It takes the original Javascript on standard input, and outputs
9 the minified output on standard output. 9 the minified output on standard output.
10 10
11 Any errors or other messages from the compiler are output on standard error. 11 Any errors or other messages from the compiler are output on standard error.
(...skipping 29 matching lines...) Expand all
41 41
42 if __name__ == '__main__': 42 if __name__ == '__main__':
43 orig_stdout = sys.stdout 43 orig_stdout = sys.stdout
44 result = '' 44 result = ''
45 try: 45 try:
46 sys.stdout = sys.stderr 46 sys.stdout = sys.stderr
47 result = Minify(sys.stdin.read()) 47 result = Minify(sys.stdin.read())
48 finally: 48 finally:
49 sys.stdout = orig_stdout 49 sys.stdout = orig_stdout
50 print result 50 print result
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698