Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/dest/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ var fs = require('graceful-fs');
var Vinyl = require('vinyl');
var Transform = require('streamx').Transform;

function newStats() {
// Node.js is cruel and emits deprecation if we don't build
// a `new Stats()` like this
var stats = Object.create(fs.Stats.prototype);
fs.Stats.prototype.constructor.call(stats);
return stats;
}

function prepareWrite(folderResolver, optResolver) {
if (!folderResolver) {
throw new Error('Invalid output folder');
Expand Down Expand Up @@ -35,7 +43,7 @@ function prepareWrite(folderResolver, optResolver) {
file.path = writePath;
if (!file.isSymbolic()) {
var mode = optResolver.resolve('mode', file);
file.stat = file.stat || new fs.Stats();
file.stat = file.stat || newStats();
file.stat.mode = mode;
}

Expand Down
10 changes: 9 additions & 1 deletion lib/symlink/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ var fs = require('graceful-fs');
var Vinyl = require('vinyl');
var Transform = require('streamx').Transform;

function newStats() {
// Node.js is cruel and emits deprecation if we don't build
// a `new Stats()` like this
var stats = Object.create(fs.Stats.prototype);
fs.Stats.prototype.constructor.call(stats);
return stats;
}

function prepareSymlink(folderResolver, optResolver) {
if (!folderResolver) {
throw new Error('Invalid output folder');
Expand All @@ -32,7 +40,7 @@ function prepareSymlink(folderResolver, optResolver) {

// Wire up new properties
// Note: keep the target stats for now, we may need them in link-file
file.stat = file.stat || new fs.Stats();
file.stat = file.stat || newStats()
file.cwd = cwd;
file.base = basePath;
// This is the path we are linking *TO*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"streamx": "^2.14.0",
"to-through": "^3.0.0",
"value-or-function": "^4.0.0",
"vinyl": "^3.0.0",
"vinyl": "^3.0.1",
"vinyl-sourcemap": "^2.0.0"
},
"devDependencies": {
Expand Down
Loading