Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
feat: added s3 template strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 7, 2018
1 parent 77afb15 commit 220580a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,26 @@ export namespace PJSON {
commands?: string
plugins?: string[]
devPlugins?: string[]
update?: {
autoupdate?: boolean | {
update: {
autoupdate?: {
rollout?: number
debounce?: number
}
node?: {
node: {
version?: string
targets?: string[]
}
s3?: {
s3: {
bucket?: string
prefix?: string
host?: string
xz?: boolean
gz?: boolean
templates: {
platformTarball: string
vanillaTarball: string
platformManifest: string
vanillaManifest: string
}
}
// github?: {}
}
Expand Down
10 changes: 10 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ export class Plugin implements IPlugin {
}

this.hooks = mapValues(this.pjson.oclif.hooks || {}, i => Array.isArray(i) ? i : [i])
this.pjson.oclif.update = this.pjson.oclif.update || {}
this.pjson.oclif.update.node = this.pjson.oclif.update.node || {}
const s3 = this.pjson.oclif.update.s3 = this.pjson.oclif.update.s3 || {}
s3.templates = {
platformTarball: '<%- name %>/channels/<%- channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %>',
vanillaTarball: '<%- name %>/channels/<%- channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>',
platformManifest: '<%- name %>/channels/<%- channel %>/<%- platform %>-<%- arch %>',
vanillaManifest: '<%- name %>/channels/<%- channel %>/version',
...s3.templates,
}

this.manifest = await this._manifest(!!this.options.ignoreManifest, !!this.options.errorOnManifestCreate)
this.commands = Object.entries(this.manifest.commands)
Expand Down

0 comments on commit 220580a

Please sign in to comment.