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

Commit

Permalink
fix: add versioned/non-versioned tarball templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Apr 9, 2018
1 parent dff9449 commit b8409f6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ export class Config implements IConfig {
s3.templates = {
platformBaseDir: '<%- bin %>',
vanillaBaseDir: '<%- bin %>',
platformTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %>",
vanillaTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>",
versionedPlatformTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %>",
platformTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>-<%- platform %>-<%- arch %>",
versionedVanillaTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>",
vanillaTarball: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- bin %>",
platformManifest: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/<%- platform %>-<%- arch %>",
vanillaManifest: "<%- name %><%- channel === 'stable' ? '' : '/channels/' + channel %>/version",
...s3.templates,
Expand Down
2 changes: 2 additions & 0 deletions src/pjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export namespace PJSON {
xz?: boolean
gz?: boolean
templates: {
versionedPlatformTarball: string
versionedVanillaTarball: string
platformTarball: string
vanillaTarball: string
platformManifest: string
Expand Down
12 changes: 8 additions & 4 deletions test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ describe('PluginConfig', () => {
}
checkTemplate('platformBaseDir', 'oclif-cli')
checkTemplate('vanillaBaseDir', 'oclif-cli')
checkTemplate('platformTarball', '@oclif/config/oclif-cli-v1.0.0/oclif-cli-v1.0.0-darwin-x64')
checkTemplate('versionedPlatformTarball', '@oclif/config/oclif-cli-v1.0.0/oclif-cli-v1.0.0-darwin-x64')
checkTemplate('platformTarball', '@oclif/config/oclif-cli-darwin-x64')
checkTemplate('platformManifest', '@oclif/config/darwin-x64')
checkTemplate('vanillaManifest', '@oclif/config/version')
checkTemplate('vanillaTarball', '@oclif/config/channels/beta/oclif-cli-v2.0.0-beta/oclif-cli-v2.0.0-beta', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('platformTarball', '@oclif/config/channels/beta/oclif-cli-v2.0.0-beta/oclif-cli-v2.0.0-beta-darwin-x64', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('versionedVanillaTarball', '@oclif/config/oclif-cli-v1.0.0/oclif-cli-v1.0.0')
checkTemplate('vanillaTarball', '@oclif/config/oclif-cli')
checkTemplate('versionedPlatformTarball', '@oclif/config/channels/beta/oclif-cli-v2.0.0-beta/oclif-cli-v2.0.0-beta-darwin-x64', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('platformTarball', '@oclif/config/channels/beta/oclif-cli-darwin-x64', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('platformManifest', '@oclif/config/channels/beta/darwin-x64', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('vanillaManifest', '@oclif/config/channels/beta/version', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('vanillaTarball', '@oclif/config/channels/beta/oclif-cli-v2.0.0-beta/oclif-cli-v2.0.0-beta', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('versionedVanillaTarball', '@oclif/config/channels/beta/oclif-cli-v2.0.0-beta/oclif-cli-v2.0.0-beta', {version: '2.0.0-beta', channel: 'beta'})
checkTemplate('vanillaTarball', '@oclif/config/channels/beta/oclif-cli', {version: '2.0.0-beta', channel: 'beta'})
})

fancy
Expand Down

0 comments on commit b8409f6

Please sign in to comment.