Skip to content

Commit

Permalink
[#1043] Fixed spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishirak committed Oct 13, 2016
1 parent 96461ae commit bd29b64
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions gulpfile.js
Expand Up @@ -378,45 +378,45 @@ function isRelative(sitePath) {
* Inspiration from https://github.com/sindresorhus/gulp-tar/blob/cbe4e1df44fdc477a3a9743cfb62ccb999748c16/index.js
*/
function compress(filename) {
if (!filename) {
return;
}

var firstFile;
var archive = archiver('zip');

return through.obj(function (file, enc, cb) {
if (file.relative === '') {
cb();
return;
}

if (firstFile === undefined) {
firstFile = file;
}

archive.append(file.contents, {
name: file.relative.replace(/\\/g, '/') + (file.isNull() ? '/' : ''),
mode: file.stat && file.stat.mode,
date: file.stat && file.stat.mtime ? file.stat.mtime : null
});

cb();
}, function (cb) {
if (firstFile === undefined) {
cb();
return;
}

archive.finalize();

this.push(new gutil.File({
cwd: firstFile.cwd,
base: firstFile.base,
path: path.join(firstFile.base, filename),
contents: archive
}));

cb();
});
if (!filename) {
return;
}

var firstFile;
var archive = archiver('zip');

return through.obj(function (file, enc, cb) {
if (file.relative === '') {
cb();
return;
}

if (firstFile === undefined) {
firstFile = file;
}

archive.append(file.contents, {
name: file.relative.replace(/\\/g, '/') + (file.isNull() ? '/' : ''),
mode: file.stat && file.stat.mode,
date: file.stat && file.stat.mtime ? file.stat.mtime : null
});

cb();
}, function (cb) {
if (firstFile === undefined) {
cb();
return;
}

archive.finalize();

this.push(new gutil.File({
cwd: firstFile.cwd,
base: firstFile.base,
path: path.join(firstFile.base, filename),
contents: archive
}));

cb();
});
}

0 comments on commit bd29b64

Please sign in to comment.