diff --git a/packages/electron-updater/src/providers/BintrayProvider.ts b/packages/electron-updater/src/providers/BintrayProvider.ts index 6596963ea4..e28f96a9fe 100644 --- a/packages/electron-updater/src/providers/BintrayProvider.ts +++ b/packages/electron-updater/src/providers/BintrayProvider.ts @@ -1,7 +1,7 @@ import { BintrayOptions, CancellationToken, newError, UpdateInfo } from "builder-util-runtime" import { BintrayClient } from "builder-util-runtime/out/bintray" import { URL } from "url" -import { getChannelFilename, newBaseUrl, newUrlFromBase, Provider, ResolvedUpdateFileInfo } from "../main" +import { getChannelFilename, newBaseUrl, Provider, ResolvedUpdateFileInfo } from "../main" import { parseUpdateInfo, ProviderRuntimeOptions, resolveFiles } from "./Provider" export class BintrayProvider extends Provider { @@ -25,13 +25,13 @@ export class BintrayProvider extends Provider { const data = await this.client.getVersion("_latest") const channelFilename = getChannelFilename(this.getDefaultChannelName()) const files = await this.client.getVersionFiles(data.name) - const channelFile = files.find(it => it.name.endsWith(`_${channelFilename}`) || it.name.endsWith(`-${channelFilename}`) || it.name === channelFilename) + const channelFile = files.find(it => it.name.endsWith(`_${channelFilename}`) || it.name.endsWith(`-${channelFilename}`)) if (channelFile == null) { // noinspection ExceptionCaughtLocallyJS throw newError(`Cannot find channel file "${channelFilename}", existing files:\n${files.map(it => JSON.stringify(it, null, 2)).join(",\n")}`, "ERR_UPDATER_CHANNEL_FILE_NOT_FOUND") } - const channelFileUrl = newUrlFromBase(channelFile.path, this.baseUrl) + const channelFileUrl = new URL(`https://dl.bintray.com/${this.client.owner}/${this.client.repo}/${channelFile.name}`) return parseUpdateInfo(await this.httpRequest(channelFileUrl), channelFilename, channelFileUrl) } catch (e) {