Skip to content

Commit

Permalink
fix: Fallback to templates for s3 gz url and baseDir (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbergman authored and jdx committed Oct 24, 2018
1 parent 540d613 commit bd7ab36
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,21 @@ export default class UpdateCommand extends Command {
await this.ensureClientDir()
const output = path.join(this.clientRoot, version)

const {response: stream} = await http.stream(manifest.gz)
const gzUrl = manifest.gz || this.config.s3Url(this.config.s3Key('versioned', {
version,
channel,
bin: this.config.bin,
platform: this.config.platform,
arch: this.config.arch,
ext: 'gz'
}))
const {response: stream} = await http.stream(gzUrl)
stream.pause()

let extraction = extract(stream, manifest.baseDir, output, manifest.sha256gz)
const baseDir = manifest.baseDir || this.config.s3Key('baseDir', {
bin: this.config.bin
})
let extraction = extract(stream, baseDir, output, manifest.sha256gz)

// TODO: use cli.action.type
if ((cli.action as any).frames) {
Expand Down

0 comments on commit bd7ab36

Please sign in to comment.