fix: file.list relative to root
This commit is contained in:
@@ -154,13 +154,12 @@ export namespace File {
|
|||||||
if (exclude.includes(entry.name)) continue
|
if (exclude.includes(entry.name)) continue
|
||||||
const fullPath = path.join(resolved, entry.name)
|
const fullPath = path.join(resolved, entry.name)
|
||||||
const relativePath = path.relative(Instance.directory, fullPath)
|
const relativePath = path.relative(Instance.directory, fullPath)
|
||||||
const relativeToRoot = path.relative(Instance.worktree, fullPath)
|
|
||||||
const type = entry.isDirectory() ? "directory" : "file"
|
const type = entry.isDirectory() ? "directory" : "file"
|
||||||
nodes.push({
|
nodes.push({
|
||||||
name: entry.name,
|
name: entry.name,
|
||||||
path: relativePath,
|
path: relativePath,
|
||||||
type,
|
type,
|
||||||
ignored: ignored(type === "directory" ? relativeToRoot + "/" : relativeToRoot),
|
ignored: ignored(type === "directory" ? relativePath + "/" : relativePath),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return nodes.sort((a, b) => {
|
return nodes.sort((a, b) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user