From 06b455d59701968e85c10fcd3fd83054e47efd9b Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Mon, 9 Apr 2018 20:51:08 -0700 Subject: [PATCH] fix: updated dev-cli --- package.json | 4 ++-- src/commands/update.ts | 8 ++------ yarn.lock | 14 +++++++------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 545c481a..d0bda061 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@heroku-cli/color": "^1.1.3", "@oclif/command": "^1.4.13", - "@oclif/config": "^1.4.14", + "@oclif/config": "^1.6.0", "@oclif/errors": "^1.0.4", "@types/semver": "^5.5.0", "cli-ux": "^3.3.28", @@ -21,7 +21,7 @@ "tar-fs": "^1.16.0" }, "devDependencies": { - "@oclif/dev-cli": "^1.10.0", + "@oclif/dev-cli": "^1.10.1", "@oclif/plugin-help": "^1.2.3", "@oclif/test": "^1.0.4", "@oclif/tslint": "^1.1.0", diff --git a/src/commands/update.ts b/src/commands/update.ts index 078453db..d1ad6c9a 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -7,7 +7,6 @@ import * as fs from 'fs-extra' import HTTP from 'http-call' import * as _ from 'lodash' import * as path from 'path' -import {URL} from 'url' import {extract} from '../tar' import {ls, wait} from '../util' @@ -45,13 +44,10 @@ export default class UpdateCommand extends Command { } private async fetchManifest(): Promise { - if (!this.s3Host) throw new Error('S3 host not defined') const http: typeof HTTP = require('http-call').HTTP try { - const key = _.template(this.config.pjson.oclif.update.s3.templates.target.versioned)({...this.config, channel: this.channel}) - const url = new URL(this.s3Host) - url.pathname = path.join(url.pathname, key) - let {body} = await http.get(url.toString()) + const url = this.config.s3Url(this.config.s3Key('manifest')) + let {body} = await http.get(url) return body } catch (err) { if (err.statusCode === 403) throw new Error(`HTTP 403: Invalid channel ${this.channel}`) diff --git a/yarn.lock b/yarn.lock index 701c68d4..23b6b3eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,18 +43,18 @@ debug "^3.1.0" semver "^5.5.0" -"@oclif/config@^1.4.0", "@oclif/config@^1.4.13", "@oclif/config@^1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.4.14.tgz#ef792b5f4b4d44540f3cebc577eca5a77d17f96a" +"@oclif/config@^1.4.0", "@oclif/config@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.0.tgz#0d9a034a3364d0ff24368e039599f89e4c00f775" dependencies: debug "^3.1.0" -"@oclif/dev-cli@^1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.10.0.tgz#2ca8b30caeaf6959a84fd791195b0e5c99a322bf" +"@oclif/dev-cli@^1.10.1": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.10.1.tgz#58546150b50c68176729581b817eb29a70106e24" dependencies: "@oclif/command" "^1.4.13" - "@oclif/config" "^1.4.13" + "@oclif/config" "^1.6.0" "@oclif/errors" "^1.0.4" "@oclif/plugin-help" "^1.2.3" "@oclif/plugin-warn-if-update-available" "^1.3.0"