Skip to content

Commit 3b70476

Browse files
committed
fix: test cases and update built artifacts
1 parent b30ef4f commit 3b70476

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

__tests__/cljstyle.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ describe('cljstyle tests', () => {
6565
describe('getArtifactName', () => {
6666
test.each`
6767
platform | artifact
68-
${'darwin'} | ${`cljstyle_1.2.3_macos.zip`}
69-
${'linux'} | ${`cljstyle_1.2.3_linux.zip`}
70-
${'foobar'} | ${`cljstyle_1.2.3_linux.zip`}
68+
${'darwin'} | ${`cljstyle_1.2.3_macos_amd64.zip`}
69+
${'linux'} | ${`cljstyle_1.2.3_linux_amd64.zip`}
70+
${'foobar'} | ${`cljstyle_1.2.3_linux_amd64.zip`}
7171
`('$platform -> $artifact', ({platform, artifact}) => {
7272
os.platform.mockReturnValueOnce(platform as never)
7373
expect(cljstyle.getArtifactName('1.2.3')).toBe(artifact)
@@ -77,9 +77,9 @@ describe('cljstyle tests', () => {
7777
describe('getArtifactUrl', () => {
7878
test.each`
7979
platform | artifact
80-
${'darwin'} | ${`cljstyle_1.2.3_macos.zip`}
81-
${'linux'} | ${`cljstyle_1.2.3_linux.zip`}
82-
${'foobar'} | ${`cljstyle_1.2.3_linux.zip`}
80+
${'darwin'} | ${`cljstyle_1.2.3_macos_amd64.zip`}
81+
${'linux'} | ${`cljstyle_1.2.3_linux_amd64.zip`}
82+
${'foobar'} | ${`cljstyle_1.2.3_linux_amd64.zip`}
8383
`('$platform -> $artifact', ({platform, artifact}) => {
8484
os.platform.mockReturnValueOnce(platform as never)
8585
expect(cljstyle.getArtifactUrl('1.2.3')).toBe(
@@ -116,7 +116,7 @@ describe('cljstyle tests', () => {
116116

117117
expect(tc.find).toHaveBeenCalledWith('cljstyle', '1.2.3')
118118
expect(tc.downloadTool).toHaveBeenCalledWith(
119-
'https://github.com/greglook/cljstyle/releases/download/1.2.3/cljstyle_1.2.3_linux.zip',
119+
'https://github.com/greglook/cljstyle/releases/download/1.2.3/cljstyle_1.2.3_linux_amd64.zip',
120120
undefined,
121121
'token 123'
122122
)
@@ -140,7 +140,7 @@ describe('cljstyle tests', () => {
140140
)
141141
expect(tc.find).toHaveBeenCalledWith('cljstyle', '9.9.9')
142142
expect(tc.downloadTool).toHaveBeenCalledWith(
143-
'https://github.com/greglook/cljstyle/releases/download/9.9.9/cljstyle_9.9.9_linux.zip',
143+
'https://github.com/greglook/cljstyle/releases/download/9.9.9/cljstyle_9.9.9_linux_amd64.zip',
144144
undefined,
145145
'token 123'
146146
)

dist/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,14 @@ function getLatestCljstyle(githubAuth) {
804804
}
805805
exports.getLatestCljstyle = getLatestCljstyle;
806806
function getArtifactName(version) {
807+
const [major, minor] = version.split('.').map(n => parseInt(n));
808+
const archiSuffix = major > 0 || minor > 15 ? '_amd64' : '';
807809
const platform = os.platform();
808810
switch (platform) {
809811
case 'darwin':
810-
return `cljstyle_${version}_macos.zip`;
812+
return `cljstyle_${version}_macos${archiSuffix}.zip`;
811813
default:
812-
return `cljstyle_${version}_linux.zip`;
814+
return `cljstyle_${version}_linux${archiSuffix}.zip`;
813815
}
814816
}
815817
exports.getArtifactName = getArtifactName;

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)