diff --git a/src/cache/DiskBasedPackageCache.ts b/src/cache/DiskBasedPackageCache.ts index f379f5a..11f5525 100644 --- a/src/cache/DiskBasedPackageCache.ts +++ b/src/cache/DiskBasedPackageCache.ts @@ -65,7 +65,7 @@ export class DiskBasedPackageCache implements PackageCache { return fs .readdirSync(contentPath, { withFileTypes: true }) .filter(entry => entry.isFile() && /^[^.].*\.json$/i.test(entry.name)) - .map(entry => path.resolve(entry.path, entry.name)) + .map(entry => path.resolve(contentPath, entry.name)) .sort(); } diff --git a/src/virtual/DiskBasedVirtualPackage.ts b/src/virtual/DiskBasedVirtualPackage.ts index efc5aa1..96655c4 100644 --- a/src/virtual/DiskBasedVirtualPackage.ts +++ b/src/virtual/DiskBasedVirtualPackage.ts @@ -138,11 +138,9 @@ function getFilePaths(paths: string[], recursive: boolean): string[] { } else if (stat.isDirectory()) { fs.readdirSync(p, { withFileTypes: true }).forEach(entry => { if (entry.isFile()) { - filePaths.add(path.resolve(entry.parentPath, entry.name)); + filePaths.add(path.resolve(p, entry.name)); } else if (recursive && entry.isDirectory()) { - getFilePaths([path.resolve(entry.parentPath, entry.name)], recursive).forEach(fp => - filePaths.add(fp) - ); + getFilePaths([path.resolve(p, entry.name)], recursive).forEach(fp => filePaths.add(fp)); } }); }