Skip to content

Commit

Permalink
fix: dereference copied app files only for windows targets
Browse files Browse the repository at this point in the history
In any case we don't reference if asar
  • Loading branch information
develar committed Jul 1, 2016
1 parent 11e6d0f commit bf2aafb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/platformPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>

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

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

private getParsedPatterns(patterns: Array<string>, arch: Arch): Array<Minimatch> {
Expand Down
2 changes: 1 addition & 1 deletion src/util/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as path from "path"
const __awaiter = require("./awaiter")

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

0 comments on commit bf2aafb

Please sign in to comment.