I want to minify my JavaScript files immediately in Gedit. I tried do it via external tools option with jsmin.js script. I have SpiderMonkey engine installed. I stored jsmin.js file at /home/mushex/use/js/jsmin.js and created a new js file named jsmin-low.js in the same directory with content
#!/usr/bin/js
load('/home/mushex/use/js/jsmin.js');
var body = arguments[0],
result = jsmin('', body, 1);
if (result) {
print(result);
} else {
print(body);
}
It prints out undefined. For debugging I've changed script to perform only in argument printing action , and saw that input is null (undefined). Source of file for debugging was
#!/usr/bin/js
print(arguments[0]);
But when I'm running it in command line it's output is correct. And via gedit other js command line tools are working normal. Wandering why my input arguments don't passing.
Here are settings I set for this tool in gedit.
Settings http://imagebin.org/index.php?mode=image&id=63960
Any help will be greatly appreciated Thanks.