diff --git a/.gitignore b/.gitignore index 8b3ab2f..08d7879 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ workspace node_modules browser-version/src +browser-version/node_modules diff --git a/browser-version/build.js b/browser-version/build.js index 9428aa9..c7ad94b 100644 --- a/browser-version/build.js +++ b/browser-version/build.js @@ -4,49 +4,57 @@ var fs = require('fs-extra') , path = require('path') + , child_process = require('child_process') , async = require('async') - , rimraf = require('rimraf') + //, rimraf = require('rimraf') , srcContents = fs.readdirSync(path.join(__dirname, 'src')) , toCopy = ['lib', 'node_modules'] ; -async.waterfall([ -function (cb) { - console.log("Removing contents of the src directory"); - - srcContents.forEach(function (item) { - var fullPath = path.join(__dirname, 'src', item); - rimraf.sync(fullPath); - }); - - return 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"); - - 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 (err) { - if (err) { - console.log("Error during build"); - console.log(err); - } else { - console.log("Build finished with success"); - } +child_process.exec('npm install rimraf', function (err, stdout, stderr) { + console.log("=============="); + console.log(stdout); + }); +//async.waterfall([ +//function (cb) { + //console.log("Removing contents of the src directory"); + + //srcContents.forEach(function (item) { + //var fullPath = path.join(__dirname, 'src', item); + //rimraf.sync(fullPath); + //}); + + //return 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"); + + //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 (err) { + //if (err) { + //console.log("Error during build"); + //console.log(err); + //} else { + //console.log("Build finished with success"); + //} +//}); + +