From 98c2c8e6a889f108d1d8a03a223281335c36bc34 Mon Sep 17 00:00:00 2001 From: develar Date: Tue, 17 Jan 2017 09:49:34 +0100 Subject: [PATCH] =?UTF-8?q?fix(publish):=20resolve=20any=20publish=20confi?= =?UTF-8?q?guration=20=E2=80=94=20not=20only=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../electron-builder/src/publish/PublishManager.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/electron-builder/src/publish/PublishManager.ts b/packages/electron-builder/src/publish/PublishManager.ts index 28b706214e6..5455955c95b 100644 --- a/packages/electron-builder/src/publish/PublishManager.ts +++ b/packages/electron-builder/src/publish/PublishManager.ts @@ -64,7 +64,7 @@ export class PublishManager { } const packager = event.packager - const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null)) + const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, false)) if (publishConfigs == null || publishConfigs.length === 0) { return } @@ -78,7 +78,7 @@ export class PublishManager { private async artifactCreated(event: ArtifactCreated) { const packager = event.packager const target = event.target - const publishConfigs = event.publishConfig == null ? await getPublishConfigs(packager, target == null ? null : (packager.config)[target.name]) : [event.publishConfig] + const publishConfigs = event.publishConfig == null ? await getPublishConfigs(packager, target == null ? null : (packager.config)[target.name], !this.isPublishOptionGuessed) : [event.publishConfig] if (publishConfigs == null) { if (this.isPublish) { @@ -170,7 +170,6 @@ async function getPublishConfigsForUpdateInfo(packager: PlatformPackager, p } } return publishConfigs - } async function writeUpdateInfo(event: ArtifactCreated, _publishConfigs: Array) { @@ -274,7 +273,7 @@ function computeDownloadUrl(publishConfig: PublishConfiguration, fileName: strin } } -export function getPublishConfigs(packager: PlatformPackager, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined): Promise> | null { +export function getPublishConfigs(packager: PlatformPackager, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined, errorIfCannot: boolean): Promise> | null { let publishers // check build.nsis (target) @@ -296,7 +295,6 @@ export function getPublishConfigs(packager: PlatformPackager, targetSpecifi if (publishers == null) { publishers = packager.config.publish - // triple equals - if explicitly set to null if (publishers === null) { return null } @@ -310,8 +308,7 @@ export function getPublishConfigs(packager: PlatformPackager, targetSpecifi } } - //await getResolvedPublishConfig(packager.info, {provider: repositoryInfo.type}, false) - return BluebirdPromise.map(asArray(publishers), it => typeof it === "string" ? getResolvedPublishConfig(packager.info, {provider: it}, true) : it) + return BluebirdPromise.map(asArray(publishers), it => getResolvedPublishConfig(packager.info, typeof it === "string" ? {provider: it} : it, errorIfCannot)) } function sha256(file: string) {