@jsenv/filesystem 4.10.7 → 4.10.9
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
|
@@ -251,7 +251,7 @@ export const registerDirectoryLifecycle = (
|
|
|
251
251
|
const directoryUrlObject = new URL(directoryUrl);
|
|
252
252
|
entryNameArray = readdirSync(directoryUrlObject);
|
|
253
253
|
} catch (e) {
|
|
254
|
-
if (e.code === "ENOENT") {
|
|
254
|
+
if (e.code === "ENOENT" || e.code === "EACCES") {
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
throw e;
|
|
@@ -265,22 +265,29 @@ export const registerDirectoryLifecycle = (
|
|
|
265
265
|
}
|
|
266
266
|
// we must watch manually every directory we find
|
|
267
267
|
if (!fsWatchSupportsRecursive) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
tracker.registerCleanupCallback(() => {
|
|
272
|
-
watcher.close();
|
|
273
|
-
});
|
|
274
|
-
watcher.on("change", (eventType, filename) => {
|
|
275
|
-
handleDirectoryEvent({
|
|
276
|
-
directoryRelativeUrl: entryInfo.relativeUrl,
|
|
277
|
-
filename: filename
|
|
278
|
-
? // replace back slashes with slashes
|
|
279
|
-
filename.replace(/\\/g, "/")
|
|
280
|
-
: "",
|
|
281
|
-
eventType,
|
|
268
|
+
try {
|
|
269
|
+
const watcher = createWatcher(urlToFileSystemPath(entryInfo.url), {
|
|
270
|
+
persistent: keepProcessAlive,
|
|
282
271
|
});
|
|
283
|
-
|
|
272
|
+
tracker.registerCleanupCallback(() => {
|
|
273
|
+
watcher.close();
|
|
274
|
+
});
|
|
275
|
+
watcher.on("change", (eventType, filename) => {
|
|
276
|
+
handleDirectoryEvent({
|
|
277
|
+
directoryRelativeUrl: entryInfo.relativeUrl,
|
|
278
|
+
filename: filename
|
|
279
|
+
? // replace back slashes with slashes
|
|
280
|
+
filename.replace(/\\/g, "/")
|
|
281
|
+
: "",
|
|
282
|
+
eventType,
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
} catch (e) {
|
|
286
|
+
if (e.code === "ENOENT" || e.code === "EACCES") {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
throw e;
|
|
290
|
+
}
|
|
284
291
|
}
|
|
285
292
|
}
|
|
286
293
|
if (added && entryInfo.patternValue && notify) {
|