Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing windows test with a temporary workaround #124

Merged
merged 1 commit into from
Feb 20, 2020
Merged
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
20 changes: 20 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const debug = require('debug');
const FSTree = require('fs-tree-diff');
const BlankObject = require('blank-object');
const heimdall = require('heimdalljs');
const fs = require('fs');

function ApplyPatchesSchema() {
this.mkdir = 0;
Expand Down Expand Up @@ -42,6 +43,19 @@ function isNotAPattern(pattern) {

return true;
}
function existsSync(path) {
let error = {};
try {
fs.accessSync(path);
fs.statSync(path);
} catch (err) {
error = err;
}
if (error.errno && error.errno !== 0) {
return false;
}
return true;
}

class Funnel extends Plugin {
constructor(inputNode, options = {}) {
Expand Down Expand Up @@ -208,6 +222,12 @@ class Funnel extends Plugin {

// This is specifically looking for broken symlinks.
let outputPathExists = this.output.existsSync('./');
// We need to keep this till node 10,12 get fix for windows broken symlink issue.
// https://github.com/nodejs/node/issues/30538
let isWin = process.platform === 'win32';
if (isWin) {
outputPathExists = existsSync(this.outputPath);
}

// Doesn't count as a rebuild if there's not an existing outputPath.
this._isRebuild = this._isRebuild && outputPathExists;
Expand Down