From bae9014ea29a80f4c1eea031ae71a309cab8e9d3 Mon Sep 17 00:00:00 2001 From: Bob Bergman Date: Tue, 23 Oct 2018 17:47:48 -0600 Subject: [PATCH] Fallback to templates for s3 gz url and baseDir --- src/commands/update.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/commands/update.ts b/src/commands/update.ts index 1d1e77fb..92670f0d 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -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) {