diff --git a/BuildServer/lib/tasks/writefile.js b/BuildServer/lib/tasks/writefile.js new file mode 100644 index 0000000..d60017b --- /dev/null +++ b/BuildServer/lib/tasks/writefile.js @@ -0,0 +1,23 @@ +"use strict"; + +var fs = require('fs'); +var async = require('async'); +var glob = require('glob'); + +module.exports = function (params, processor) { + return { + process: function () { + var filePath = processor.context.exported + "/" + params.filename; + processor.onInfo("Writing to " + filePath); + + fs.writeFile(filePath, params.data, function(err) { + if (err) { + processor.onError("Unable to write file: " + err); + } else { + processor.onInfo("Written file"); + } + return processor.done(); + }); + } + }; +};