Skip to content

Commit

Permalink
fix: adds nightly channel, adds arm64 tars (#704)
Browse files Browse the repository at this point in the history
* fix: adds nightly channel, adds arm64 tars

* chore: revert logs
  • Loading branch information
iowillhoit authored Mar 3, 2023
1 parent 7009829 commit 6e4a44b
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/commands/cli/versions/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,24 @@ export enum Channel {
STABLE_RC = 'stable-rc',
LATEST = 'latest',
LATEST_RC = 'latest-rc',
NIGHTLY = 'nightly',
}

export enum Location {
ARCHIVE = 'archive',
NPM = 'npm',
}

type ArchiveChannel = Extract<Channel, Channel.STABLE | Channel.STABLE_RC | Channel.LEGACY>;
type ArchiveChannel = Extract<Channel, Channel.STABLE | Channel.STABLE_RC | Channel.NIGHTLY | Channel.LEGACY>;
type Archives = Record<ArchiveChannel, string[]>;
type ChannelMapping = Record<Location, Record<Channel, Channel>>;

const ARCHIVES: Archives = {
[Channel.STABLE]: [
'%s/%s-darwin-x64.tar.gz',
'%s/%s-darwin-x64.tar.xz',
'%s/%s-darwin-arm64.tar.gz',
'%s/%s-darwin-arm64.tar.xz',
'%s/%s-linux-arm.tar.gz',
'%s/%s-linux-arm.tar.xz',
'%s/%s-linux-x64.tar.gz',
Expand All @@ -82,6 +85,22 @@ const ARCHIVES: Archives = {
[Channel.STABLE_RC]: [
'%s/%s-darwin-x64.tar.gz',
'%s/%s-darwin-x64.tar.xz',
'%s/%s-darwin-arm64.tar.gz',
'%s/%s-darwin-arm64.tar.xz',
'%s/%s-linux-arm.tar.gz',
'%s/%s-linux-arm.tar.xz',
'%s/%s-linux-x64.tar.gz',
'%s/%s-linux-x64.tar.xz',
'%s/%s-win32-x64.tar.gz',
'%s/%s-win32-x64.tar.xz',
'%s/%s-win32-x86.tar.gz',
'%s/%s-win32-x86.tar.xz',
],
[Channel.NIGHTLY]: [
'%s/%s-darwin-x64.tar.gz',
'%s/%s-darwin-x64.tar.xz',
'%s/%s-darwin-arm64.tar.gz',
'%s/%s-darwin-arm64.tar.xz',
'%s/%s-linux-arm.tar.gz',
'%s/%s-linux-arm.tar.xz',
'%s/%s-linux-x64.tar.gz',
Expand Down Expand Up @@ -112,13 +131,15 @@ const CHANNEL_MAPPING: ChannelMapping = {
[Channel.STABLE_RC]: Channel.LATEST_RC,
[Channel.STABLE]: Channel.LATEST,
[Channel.LATEST_RC]: Channel.LATEST_RC,
[Channel.NIGHTLY]: Channel.NIGHTLY,
[Channel.LATEST]: Channel.LATEST,
[Channel.LEGACY]: Channel.LEGACY,
},
[Location.ARCHIVE]: {
[Channel.LATEST_RC]: Channel.STABLE_RC,
[Channel.LATEST]: Channel.STABLE,
[Channel.STABLE_RC]: Channel.STABLE_RC,
[Channel.NIGHTLY]: Channel.NIGHTLY,
[Channel.STABLE]: Channel.STABLE,
[Channel.LEGACY]: Channel.LEGACY,
},
Expand Down Expand Up @@ -218,6 +239,7 @@ export default class Inspect extends SfCommand<Info[]> {
const cli = ensure<CLI>(this.flags.cli);
const stablePath = `https://developer.salesforce.com/media/salesforce-cli/${cli}/channels/stable`;
const stableRcPath = `https://developer.salesforce.com/media/salesforce-cli/${cli}/channels/stable-rc`;
const nightlyPath = `https://developer.salesforce.com/media/salesforce-cli/${cli}/channels/nightly`;
this.archives = {} as Archives;
for (const [channel, paths] of Object.entries(ARCHIVES)) {
if (channel === Channel.LEGACY && cli === CLI.SFDX) {
Expand All @@ -232,6 +254,8 @@ export default class Inspect extends SfCommand<Info[]> {
this.archives[channel] = paths.map((p) => util.format(p, stablePath, this.flags.cli));
} else if (channel === Channel.STABLE_RC) {
this.archives[channel] = paths.map((p) => util.format(p, stableRcPath, this.flags.cli));
} else if (channel === Channel.NIGHTLY) {
this.archives[channel] = paths.map((p) => util.format(p, nightlyPath, this.flags.cli));
}
}
}
Expand Down

0 comments on commit 6e4a44b

Please sign in to comment.