Skip to content

Commit bf2aafb

Browse files
committed
fix: dereference copied app files only for windows targets
In any case we don't reference if asar
1 parent 11e6d0f commit bf2aafb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/platformPackager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
197197

198198
const filter = createFilter(this.info.appDir, this.getParsedPatterns(patterns, arch), ignoreFiles, rawFilter)
199199
const promise = asarOptions == null ?
200-
copyFiltered(this.info.appDir, appPath, filter, true)
200+
copyFiltered(this.info.appDir, appPath, filter, this.platform === Platform.WINDOWS)
201201
: createAsarArchive(this.info.appDir, resourcesPath, asarOptions, filter)
202202

203203
const promises = [promise, unlinkIfExists(path.join(resourcesPath, "default_app.asar")), unlinkIfExists(path.join(appOutDir, "version"))]
@@ -301,7 +301,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
301301
private async doCopyExtraFiles(isResources: boolean, appOutDir: string, arch: Arch, customBuildOptions: DC): Promise<any> {
302302
const base = isResources ? this.getResourcesDir(appOutDir) : this.platform === Platform.MAC ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents") : appOutDir
303303
const patterns = this.getFilePatterns(isResources ? "extraResources" : "extraFiles", customBuildOptions)
304-
return patterns == null || patterns.length === 0 ? null : copyFiltered(this.projectDir, base, createFilter(this.projectDir, this.getParsedPatterns(patterns, arch)))
304+
return patterns == null || patterns.length === 0 ? null : copyFiltered(this.projectDir, base, createFilter(this.projectDir, this.getParsedPatterns(patterns, arch)), this.platform === Platform.WINDOWS)
305305
}
306306

307307
private getParsedPatterns(patterns: Array<string>, arch: Arch): Array<Minimatch> {

src/util/filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as path from "path"
77
const __awaiter = require("./awaiter")
88

99
// we use relative path to avoid canonical path issue - e.g. /tmp vs /private/tmp
10-
export function copyFiltered(src: string, destination: string, filter: (file: string) => boolean, dereference: boolean = false): Promise<any> {
10+
export function copyFiltered(src: string, destination: string, filter: (file: string) => boolean, dereference: boolean): Promise<any> {
1111
return copy(src, destination, {
1212
dereference: dereference,
1313
filter: filter

0 commit comments

Comments
 (0)