nodejs-closure-compiler/nodejs-closure-compiler-invoke.patch
2022-06-30 08:47:50 +00:00

47 lines
1.2 KiB
Diff

commit 2a9727fa15ef3ab823d9b4daad4395c0bc6c0840
Author: Tom Hughes <tom@compton.nu>
Date: Thu Apr 24 00:18:35 2014 +0100
Use closure-compiler wrapper script to get correct class path
diff --git a/src/index.coffee b/src/index.coffee
index dddddb5..8a85770 100644
--- a/src/index.coffee
+++ b/src/index.coffee
@@ -22,11 +22,7 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
spawn = require('child_process').spawn
-path = require 'path'
-JAVA_PATH = exports.JAVA_PATH = 'java'
-# Load `compiler.jar` using Node's regular lookup mechanism.
-JAR_PATH = exports.JAR_PATH = require.resolve('google-closure-compiler/compiler.jar');
OPTIONS = exports.OPTIONS = {}
exports.compile = (input, options, callback) ->
@@ -43,11 +39,6 @@ exports.compile = (input, options, callback) ->
args = []
- if !options.jar
- options.jar = JAR_PATH
-
- args.push('-jar')
- args.push(options.jar)
delete options.jar
Object.keys(options).forEach (key) ->
@@ -68,7 +59,7 @@ exports.compile = (input, options, callback) ->
if value != true
args.push value
- compiler = spawn JAVA_PATH, args
+ compiler = spawn 'closure-compiler', args
stdout = ''
stderr = ''
--
2.30.0