Skip to content

Commit

Permalink
fix: use target tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 10, 2018
1 parent 06b455d commit 701e8c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -46,7 +45,11 @@ export default class UpdateCommand extends Command {
private async fetchManifest(): Promise<IManifest> {
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) {
Expand Down
14 changes: 12 additions & 2 deletions test/commands/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,28 @@ 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')
await release('1.0.1')
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')
})
})

0 comments on commit 701e8c7

Please sign in to comment.