Skip to content

Commit f23daff

Browse files
Markus Müllerdevelar
authored andcommitted
fix(electron-updater): channel & channelFile mismatch for macOS GenericProvider publishing (#1203) (#1206)
1 parent b902972 commit f23daff

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/electron-updater/src/GenericProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Provider, FileInfo, getDefaultChannelName, getChannelFilename, getCurrentPlatform } from "./api"
1+
import { Provider, FileInfo, getDefaultChannelName, getCustomChannelName, getChannelFilename, getCurrentPlatform } from "./api"
22
import { GenericServerOptions, UpdateInfo } from "electron-builder-http/out/publishOptions"
33
import * as url from "url"
44
import * as path from "path"
@@ -7,7 +7,7 @@ import { HttpError, request } from "electron-builder-http"
77

88
export class GenericProvider extends Provider<UpdateInfo> {
99
private readonly baseUrl = url.parse(this.configuration.url)
10-
private readonly channel = this.configuration.channel || getDefaultChannelName()
10+
private readonly channel = this.configuration.channel ? getCustomChannelName(this.configuration.channel) : getDefaultChannelName()
1111

1212
constructor(private readonly configuration: GenericServerOptions) {
1313
super()

packages/electron-updater/src/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export function getDefaultChannelName() {
3030
return channel
3131
}
3232

33+
export function getCustomChannelName(channel: string) {
34+
return `${channel}${(getCurrentPlatform()) === "darwin" ? "-mac" : ""}`
35+
}
36+
3337
export function getCurrentPlatform () {
3438
return process.env.TEST_UPDATER_PLATFORM || process.platform
3539
}

0 commit comments

Comments
 (0)