From cd33c3d5db7a71086f58a0628707764cb8899703 Mon Sep 17 00:00:00 2001 From: Val Date: Tue, 29 Apr 2025 08:02:53 -0700 Subject: [PATCH] fix: make sure unpacked asar resources are still identified as APP_CODE PR #124 introduced a regression where the following path: Contents/Resources/app.asar.unpacked/node_modules/fsevents/fsevents.node Would get identified as `AppFileType.MACHO` instead of `AppFileType.APP_CODE` as it was previously We need to make sure that path containing `.asar.unpacked/` are also treated as `APP_CODE` --- src/file-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file-utils.ts b/src/file-utils.ts index 08dc1e3..5be7d22 100644 --- a/src/file-utils.ts +++ b/src/file-utils.ts @@ -45,7 +45,9 @@ export const getAllAppFiles = async (appPath: string): Promise => { throw e; } } - if (p.endsWith('.asar')) { + // Need to match both e.g. `Contents/Resources/app.asar` and + // `Contents/Resources/app.asar.unpacked/node_modules/fsevents/fsevents.node` + if (p.endsWith('.asar') || p.includes('.asar.unpacked/')) { fileType = AppFileType.APP_CODE; } else if (fileOutput.startsWith(MACHO_PREFIX)) { fileType = AppFileType.MACHO;