Formatting

This commit is contained in:
Sam Potts
2017-04-15 23:22:14 +10:00
parent 889712761a
commit 5d38497f07
3 changed files with 43 additions and 22 deletions

View File

@ -1,9 +1,9 @@
// ==========================================================================
// Gulp build script
// ==========================================================================
/*global require, __dirname,Buffer*/
/*jshint -W079 */
/* global require, __dirname,Buffer */
/* jshint -W079 */
/* beautify ignore:start */
var fs = require("fs"),
path = require("path"),
gulp = require("gulp"),
@ -77,20 +77,20 @@ function loadJSON(path) {
// Create a file from a string
// http://stackoverflow.com/questions/23230569/how-do-you-create-a-file-from-a-string-in-gulp
function createFile(filename, string) {
var src = require('stream').Readable({
objectMode: true
var src = require('stream').Readable({
objectMode: true
});
src._read = function () {
this.push(new gutil.File({
cwd: "",
base: "",
path: filename,
this.push(new gutil.File({
cwd: "",
base: "",
path: filename,
contents: new Buffer(string),
// stats also required for some functions
// https://nodejs.org/api/fs.html#fs_class_fs_stats
stat: {
size: string.length
}
}
}));
this.push(null);
}
@ -335,3 +335,5 @@ gulp.task("open", function () {
gulp.task("publish", function () {
run(tasks.js, tasks.less, tasks.sprite, "cdn", "demo");
});
/* beautify ignore:end */