From 8d2c71fa0c9364c954348eedcb587fb1b73b6c73 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Sat, 13 Jul 2013 18:45:53 +0200 Subject: [PATCH] Complete uncommented file --- browser-version/build.js | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/browser-version/build.js b/browser-version/build.js index c4097f2..268b06a 100644 --- a/browser-version/build.js +++ b/browser-version/build.js @@ -27,8 +27,8 @@ ensureDirExists('src'); // Installing build dependencies and require them console.log("Installing build dependencies"); -//child_process.exec('npm install fs-extra async uglify-js browserify', function (err, stdout, stderr) { - //if (err) { console.log("Error reinstalling dependencies"); process.exit(1); } +child_process.exec('npm install fs-extra async uglify-js browserify', function (err, stdout, stderr) { + if (err) { console.log("Error reinstalling dependencies"); process.exit(1); } fs = require('fs-extra'); async = require('async'); @@ -36,28 +36,28 @@ console.log("Installing build dependencies"); uglify = require('uglify-js'); async.waterfall([ - //function (cb) { - //console.log("Removing contents of the src directory"); + function (cb) { + console.log("Removing contents of the src directory"); - //async.eachSeries(fs.readdirSync(path.join(__dirname, 'src')), function (item, _cb) { - //fs.remove(path.join(__dirname, 'src', item), _cb); - //}, cb); - //} - //, function (cb) { - //console.log("Copying source files"); + async.eachSeries(fs.readdirSync(path.join(__dirname, 'src')), function (item, _cb) { + fs.remove(path.join(__dirname, 'src', item), _cb); + }, cb); + } + , function (cb) { + console.log("Copying source files"); - //async.eachSeries(toCopy, function (item, _cb) { - //fs.copy(path.join(__dirname, '..', item), path.join(__dirname, 'src', item), _cb); - //}, cb); - //} - //, function (cb) { - //console.log("Copying browser specific files to replace their server-specific counterparts"); + async.eachSeries(toCopy, function (item, _cb) { + fs.copy(path.join(__dirname, '..', item), path.join(__dirname, 'src', item), _cb); + }, cb); + } + , function (cb) { + console.log("Copying browser specific files to replace their server-specific counterparts"); - //async.eachSeries(fs.readdirSync(path.join(__dirname, 'browser-specific')), function (item, _cb) { - //fs.copy(path.join(__dirname, 'browser-specific', item), path.join(__dirname, 'src', item), _cb); - //}, cb); - //} - function (cb) { + async.eachSeries(fs.readdirSync(path.join(__dirname, 'browser-specific')), function (item, _cb) { + fs.copy(path.join(__dirname, 'browser-specific', item), path.join(__dirname, 'src', item), _cb); + }, cb); + } + , function (cb) { console.log("Browserifying the code"); var b = browserify() @@ -89,7 +89,7 @@ console.log("Installing build dependencies"); console.log("Build finished with success"); } }); -//}); +});