mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Merge pull request #1111 from aspnet/rel/2.0.0
Complete the lstat patching for #1101
This commit is contained in:
@@ -149,7 +149,7 @@
|
|||||||
var path = __webpack_require__(3);
|
var path = __webpack_require__(3);
|
||||||
var startsWith = function (str, prefix) { return str.substring(0, prefix.length) === prefix; };
|
var startsWith = function (str, prefix) { return str.substring(0, prefix.length) === prefix; };
|
||||||
var appRootDir = process.cwd();
|
var appRootDir = process.cwd();
|
||||||
function patchedLStat(pathToStatLong) {
|
function patchedLStat(pathToStatLong, fsReqWrap) {
|
||||||
try {
|
try {
|
||||||
// If the lstat completes without errors, we don't modify its behavior at all
|
// If the lstat completes without errors, we don't modify its behavior at all
|
||||||
return origLStat.apply(this, arguments);
|
return origLStat.apply(this, arguments);
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
// ancestor directories are symlinks or not. If there's a genuine file
|
// ancestor directories are symlinks or not. If there's a genuine file
|
||||||
// permissions issue, it will still surface later when Node actually
|
// permissions issue, it will still surface later when Node actually
|
||||||
// tries to read the file.
|
// tries to read the file.
|
||||||
return origLStat.call(this, appRootDir);
|
return origLStat.call(this, appRootDir, fsReqWrap);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// In any other case, preserve the original error
|
// In any other case, preserve the original error
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as path from 'path';
|
|||||||
const startsWith = (str: string, prefix: string) => str.substring(0, prefix.length) === prefix;
|
const startsWith = (str: string, prefix: string) => str.substring(0, prefix.length) === prefix;
|
||||||
const appRootDir = process.cwd();
|
const appRootDir = process.cwd();
|
||||||
|
|
||||||
function patchedLStat(pathToStatLong: string) {
|
function patchedLStat(pathToStatLong: string, fsReqWrap?: any) {
|
||||||
try {
|
try {
|
||||||
// If the lstat completes without errors, we don't modify its behavior at all
|
// If the lstat completes without errors, we don't modify its behavior at all
|
||||||
return origLStat.apply(this, arguments);
|
return origLStat.apply(this, arguments);
|
||||||
@@ -19,7 +19,7 @@ function patchedLStat(pathToStatLong: string) {
|
|||||||
// ancestor directories are symlinks or not. If there's a genuine file
|
// ancestor directories are symlinks or not. If there's a genuine file
|
||||||
// permissions issue, it will still surface later when Node actually
|
// permissions issue, it will still surface later when Node actually
|
||||||
// tries to read the file.
|
// tries to read the file.
|
||||||
return origLStat.call(this, appRootDir);
|
return origLStat.call(this, appRootDir, fsReqWrap);
|
||||||
} else {
|
} else {
|
||||||
// In any other case, preserve the original error
|
// In any other case, preserve the original error
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
Reference in New Issue
Block a user