|
@@ -612,9 +612,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
|
|
if (options.withFileTypes) {
|
|
|
const dirents = [];
|
|
|
for (const file of files) {
|
|
|
- const stats = archive.stat(file);
|
|
|
+ const childPath = path.join(filePath, file);
|
|
|
+ const stats = archive.stat(childPath);
|
|
|
if (!stats) {
|
|
|
- const error = createError(AsarError.NOT_FOUND, { asarPath, filePath: file });
|
|
|
+ const error = createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
|
|
nextTick(callback!, [error]);
|
|
|
return;
|
|
|
}
|
|
@@ -654,9 +655,10 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
|
|
|
if (options && (options as any).withFileTypes) {
|
|
|
const dirents = [];
|
|
|
for (const file of files) {
|
|
|
- const stats = archive.stat(file);
|
|
|
+ const childPath = path.join(filePath, file);
|
|
|
+ const stats = archive.stat(childPath);
|
|
|
if (!stats) {
|
|
|
- throw createError(AsarError.NOT_FOUND, { asarPath, filePath: file });
|
|
|
+ throw createError(AsarError.NOT_FOUND, { asarPath, filePath: childPath });
|
|
|
}
|
|
|
if (stats.isFile) {
|
|
|
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
|