Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit b0328d3

Browse files
committed
Exclude .git files from console warnings
1 parent df26beb commit b0328d3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/filesystem/impls/appshell/AppshellFileSystem.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ define(function (require, exports, module) {
3535

3636
var FILE_WATCHER_BATCH_TIMEOUT = 200; // 200ms - granularity of file watcher changes
3737

38+
/** exclude .git files from warnings as they appear and disappear very quickly and pollute the console */
39+
var warningBlacklist = /\/\.git\//;
40+
3841
/**
3942
* Callback to notify FileSystem of watcher changes
4043
* @type {?function(string, FileSystemStats=)}
@@ -91,7 +94,9 @@ define(function (require, exports, module) {
9194
if (needsStats) {
9295
exports.stat(path, function (err, stats) {
9396
if (err) {
94-
console.warn("Unable to stat changed path: ", path, err);
97+
if (!warningBlacklist.test(path)) {
98+
console.warn("Unable to stat changed path: ", path, err);
99+
}
95100
return;
96101
}
97102
_changeCallback(path, stats);

0 commit comments

Comments
 (0)