Skip to content

Commit

Permalink
fix(nsis): Incorrect app-update.yml for Windows 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Feb 23, 2017
1 parent d1c26e9 commit 5cfc693
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/electron-builder/src/fileMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class FileMatcher {

private expandPattern(pattern: string): string {
return pattern
.replace(/\$\{arch}/g, this.options.arch)
.replace(/\$\{arch}/g, this.options.arch!)
.replace(/\$\{os}/g, this.options.os)
.replace(/\$\{\/\*}/g, "{,/**/*}")
}
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {

export interface Macros {
os: string
arch: string
arch: string | null
}

export function getPlatformIconFileName(value: string | null | undefined, isMac: boolean) {
Expand Down
18 changes: 15 additions & 3 deletions packages/electron-builder/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class PublishManager implements PublishContext {

let publishConfig = publishConfigs[0]
if ((<GenericServerOptions>publishConfig).url != null) {
publishConfig = Object.assign({}, publishConfig, {url: expandPattern((<GenericServerOptions>publishConfig).url, {os: packager.platform.buildConfigurationKey, arch: Arch[Arch.x64]})})
publishConfig = Object.assign({}, publishConfig, {url: expandPattern((<GenericServerOptions>publishConfig).url, {os: packager.platform.buildConfigurationKey, arch: packager.platform === Platform.WINDOWS ? null : Arch[Arch.x64]})})
}

if (packager.platform === Platform.WINDOWS) {
Expand Down Expand Up @@ -322,9 +322,21 @@ export function computeDownloadUrl(publishConfig: PublishConfiguration, fileName
}

function expandPattern(pattern: string, macros: Macros): string {
const arch = macros.arch
if (arch == null) {
pattern = pattern
.replace("-${arch}", "")
.replace(" ${arch}", "")
.replace("_${arch}", "")
.replace("/${arch}", "")
}

pattern = pattern.replace(/\$\{os}/g, macros.os)
if (arch != null) {
pattern = pattern.replace(/\$\{arch}/g, arch)
}

return pattern
.replace(/\$\{os}/g, macros.os)
.replace(/\$\{arch}/g, macros.arch)
}

export function getPublishConfigs(packager: PlatformPackager<any>, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined, errorIfCannot: boolean): Promise<Array<PublishConfiguration>> | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Array [
exports[`perMachine, no run after finish 3`] = `
Object {
"provider": "generic",
"url": "https://develar.s3.amazonaws.com/test/win/x64",
"url": "https://develar.s3.amazonaws.com/test/win",
}
`;

Expand Down
4 changes: 3 additions & 1 deletion test/src/BuildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ test.ifDevOrLinuxCi("electron version from build", app({
})
}))

test("www as default dir", appTwo(Platform.current().createTarget(DIR_TARGET), {
test("www as default dir", appTwo({
targets: Platform.current().createTarget(DIR_TARGET),
}, {
projectDirCreated: projectDir => move(path.join(projectDir, "app"), path.join(projectDir, "www"))
}))

Expand Down

0 comments on commit 5cfc693

Please sign in to comment.