Skip to content

Commit 6662c02

Browse files
author
beicause
committed
replace fsPath with path for ignore test in windows
1 parent 65e080f commit 6662c02

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/extension.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ const generateGraph = (
5656
// working in the current workspace
5757
if (!item.uri.fsPath.startsWith(workspace.fsPath)) return true
5858
const ig = ignore().add(fs.readFileSync(ignoreFile).toString())
59-
var str, itemPath
60-
str = `${workspace.fsPath}/`
61-
itemPath = item.uri.fsPath.replace(str, '')
62-
str = `${workspace.fsPath}\\` // dir format in windows
63-
itemPath = itemPath.replace(str, '')
59+
const itemPath = item.uri.path.replace(`${workspace.path}/`, '')
6460
const ignored = ig.test(itemPath).ignored
6561
return ignored
6662
})

0 commit comments

Comments
 (0)