Skip to content

Commit

Permalink
Revert "fix: Update BintrayProvider.ts (#4921)" (#4973)
Browse files Browse the repository at this point in the history
This reverts commit 65bb441.
  • Loading branch information
atali committed May 15, 2020
1 parent 6c0f825 commit ee59eed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 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<UpdateInfo> {
Expand All @@ -25,13 +25,13 @@ export class BintrayProvider extends Provider<UpdateInfo> {
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) {
Expand Down

0 comments on commit ee59eed

Please sign in to comment.