Permalink
Browse files

use /usr/bin/env node rather than an absolute path to node!

  • Loading branch information...
1 parent 4c342d0 commit 11c3b14b6668a157b7dbae1fd64f74908f1936ad @mgh mgh committed Jan 13, 2012
Showing with 10 additions and 18 deletions.
  1. +10 −18 compilers/jsio_compile/build.js
@@ -1,4 +1,4 @@
-#!/usr/local/bin/node
+#!/usr/bin/env node
// run "node build.js" to generate a self-contained jsio_compile script
@@ -58,23 +58,15 @@ function doCompile() {
});
});
- exec("which " + node, function(error, stdout, stderr) {
- var nodeLocation = stdout.replace(/\n/g, '');
- logger.info('Found node at', nodeLocation)
- exec(nodeLocation + " --version", function(error, stdout, stderr) {
- var nodeVersion = stdout.replace(/\n/g, '');;
- logger.info('Using node version', nodeVersion);
- compiler.generateSrc({compressorCachePath: CACHE_PATH, compressSources: true, compressResult: true, preserveJsioSource: true}, function(src) {
- var fd = fs.openSync(TARGET, 'w');
- fs.writeSync(fd, '#!' + nodeLocation + '\n');
- fs.writeSync(fd, src);
- fs.writeSync(fd, 'jsio("import .compiler").start()');
- fs.closeSync(fd);
-
- exec("chmod +x " + TARGET);
- logger.info('Wrote', TARGET);
- });
- });
+ compiler.generateSrc({compressorCachePath: CACHE_PATH, compressSources: true, compressResult: true}, function(src) {
+ var fd = fs.openSync(TARGET, 'w');
+ fs.writeSync(fd, '#!/usr/bin/env node\n');
+ fs.writeSync(fd, src);
+ fs.writeSync(fd, 'jsio("import .compiler").start()');
+ fs.closeSync(fd);
+
+ exec("chmod +x " + TARGET);
+ logger.info('Wrote', TARGET);
});
}

0 comments on commit 11c3b14

Please sign in to comment.