From 701e8c7649456aa4833423a41005058d0b4ad5e0 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Mon, 9 Apr 2018 21:00:14 -0700 Subject: [PATCH] fix: use target tarball --- src/commands/update.ts | 7 +++++-- test/commands/update.test.ts | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/commands/update.ts b/src/commands/update.ts index d1ad6c9a..377f97bd 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -22,7 +22,6 @@ export default class UpdateCommand extends Command { private channel!: string private readonly clientRoot = path.join(this.config.dataDir, 'client') private readonly clientBin = path.join(this.clientRoot, 'bin', this.config.windows ? `${this.config.bin}.cmd` : this.config.bin) - private readonly s3Host = this.config.pjson.oclif.update.s3.host async run() { const {args, flags} = this.parse(UpdateCommand) @@ -46,7 +45,11 @@ export default class UpdateCommand extends Command { private async fetchManifest(): Promise { const http: typeof HTTP = require('http-call').HTTP try { - const url = this.config.s3Url(this.config.s3Key('manifest')) + const url = this.config.s3Url(this.config.s3Key('manifest', { + channel: this.channel, + platform: this.config.platform, + arch: this.config.arch + })) let {body} = await http.get(url) return body } catch (err) { diff --git a/test/commands/update.test.ts b/test/commands/update.test.ts index a339243a..4da0d883 100644 --- a/test/commands/update.test.ts +++ b/test/commands/update.test.ts @@ -45,6 +45,7 @@ describe('update', () => { await qq.x('./tmp/example-cli/bin/example-cli', args) } await release('1.0.0') + await release('2.0.0-beta') await checkVersion('1.0.0', process.versions.node) await update() await checkVersion('1.0.0') @@ -52,11 +53,20 @@ describe('update', () => { await checkVersion('1.0.0') await update() await checkVersion('1.0.1') - await release('2.0.0-beta') - await checkVersion('1.0.1') await update() await checkVersion('1.0.1') await update('beta') await checkVersion(`2.0.0-beta.${sha}`) + await release('2.0.1-beta') + await checkVersion(`2.0.0-beta.${sha}`) + await update() + await checkVersion(`2.0.1-beta.${sha}`) + await update() + await checkVersion(`2.0.1-beta.${sha}`) + await release('1.0.3') + await update() + await checkVersion(`2.0.1-beta.${sha}`) + await update('stable') + await checkVersion('1.0.3') }) })