@jsenv/filesystem 4.10.4 → 4.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -112,7 +112,7 @@ export const registerDirectoryLifecycle = (
|
|
|
112
112
|
stat: null,
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
if (e.code === "EACCES") {
|
|
115
|
+
if (e.code === "EACCES" || e.code === "EPERM") {
|
|
116
116
|
return {
|
|
117
117
|
type: null,
|
|
118
118
|
stat: null,
|
|
@@ -246,13 +246,24 @@ export const registerDirectoryLifecycle = (
|
|
|
246
246
|
infoMap.set(entryInfo.relativeUrl, entryInfo);
|
|
247
247
|
if (entryInfo.type === "directory") {
|
|
248
248
|
const directoryUrl = `${entryInfo.url}/`;
|
|
249
|
-
|
|
249
|
+
let entryNameArray;
|
|
250
|
+
try {
|
|
251
|
+
const directoryUrlObject = new URL(directoryUrl);
|
|
252
|
+
entryNameArray = readdirSync(directoryUrlObject);
|
|
253
|
+
} catch (e) {
|
|
254
|
+
if (e.code === "ENOENT") {
|
|
255
|
+
entryNameArray = [];
|
|
256
|
+
} else {
|
|
257
|
+
throw e;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
for (const entryName of entryNameArray) {
|
|
250
261
|
const childEntryUrl = new URL(entryName, directoryUrl).href;
|
|
251
262
|
const childEntryInfo = readEntryInfo(childEntryUrl);
|
|
252
263
|
if (childEntryInfo.type !== null && childEntryInfo.patternValue) {
|
|
253
264
|
handleEntryFound(childEntryInfo, { notify });
|
|
254
265
|
}
|
|
255
|
-
}
|
|
266
|
+
}
|
|
256
267
|
// we must watch manually every directory we find
|
|
257
268
|
if (!fsWatchSupportsRecursive) {
|
|
258
269
|
const watcher = createWatcher(urlToFileSystemPath(entryInfo.url), {
|