From ee59eed4b48eff87786715a30d1865d9186c24d9 Mon Sep 17 00:00:00 2001 From: Atali Date: Fri, 15 May 2020 02:50:56 -0400 Subject: [PATCH] Revert "fix: Update BintrayProvider.ts (#4921)" (#4973) This reverts commit 65bb44168ee9c2be50905f7932a87bbde491f10b. --- packages/electron-updater/src/providers/BintrayProvider.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/electron-updater/src/providers/BintrayProvider.ts b/packages/electron-updater/src/providers/BintrayProvider.ts index 6596963ea46..e28f96a9fe1 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) {