From 237d5eddd4f6e0bfa3a2a08a287c3a8d44259417 Mon Sep 17 00:00:00 2001 From: Joe Esposito Date: Sun, 22 Feb 2015 15:14:18 -0500 Subject: [PATCH] Make build.js cross-platform. --- build.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build.js b/build.js index d23df0f..fdbf145 100755 --- a/build.js +++ b/build.js @@ -1,9 +1,13 @@ #!/usr/bin/env node var fs = require('fs'); +var path = require('path'); var querystring = require('querystring'); var child_process = require('child_process'); +var browserify = path.join('node_modules', '.bin', 'browserify'); +var coffee = path.join('node_modules', '.bin', 'coffee'); + function run(command, callback) { console.log(command); child_process.exec(command, callback); @@ -11,7 +15,7 @@ function run(command, callback) { // Use browserify to package up source-map-support.js fs.writeFileSync('.temp.js', 'sourceMapSupport = require("./source-map-support");'); -run('node_modules/browserify/bin/cmd.js .temp.js', function(error, stdout) { +run(browserify + ' .temp.js', function(error, stdout) { if (error) throw error; // Wrap the code so it works both as a normal