fix ignore folders (#1929)

Co-authored-by: Linhart Lukáš <Lukas.Linhart@tescosw.cz>
This commit is contained in:
Lukáš Linhart 2024-04-09 22:59:14 +02:00 committed by GitHub
parent 0cce14b4d5
commit acca7984a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -415,12 +415,12 @@ class Watcher {
ignoreInitial: false, ignoreInitial: false,
usePolling: watchPath.startsWith('\\\\') ? true : false, usePolling: watchPath.startsWith('\\\\') ? true : false,
ignored: (filepath) => { ignored: (filepath) => {
const normalizedPath = filepath.replace(/\\/g, '/'); const relativePath = path.relative(watchPath, filepath);
const relativePath = path.relative(watchPath, normalizedPath); const normalizedPath = relativePath.replace(/\\/g, '/');
return ignores.some((ignorePattern) => { return ignores.some((ignorePattern) => {
const normalizedIgnorePattern = ignorePattern.replace(/\\/g, '/'); const normalizedIgnorePattern = ignorePattern.replace(/\\/g, '/');
return relativePath === normalizedIgnorePattern || relativePath.startsWith(normalizedIgnorePattern); return normalizedPath === normalizedIgnorePattern || normalizedPath.startsWith(normalizedIgnorePattern);
}); });
}, },
persistent: true, persistent: true,