Skip to content

Commit 52d9c0e

Browse files
MarshallOfSoundmalept
authored andcommitted
fix: actually use the artifactSuffix when generating the filename (#111)
1 parent 7c8b45b commit 52d9c0e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/artifact-utils.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export function getArtifactFileName(
2727

2828
ensureIsTruthyString(details, 'platform');
2929
ensureIsTruthyString(details, 'arch');
30-
return `${[details.artifactName, details.version, details.platform, details.arch].join('-')}.zip`;
30+
return `${[
31+
details.artifactName,
32+
details.version,
33+
details.platform,
34+
details.arch,
35+
...(details.artifactSuffix ? [details.artifactSuffix] : []),
36+
].join('-')}.zip`;
3137
}
3238

3339
function mirrorVar(name: keyof MirrorOptions, options: MirrorOptions, defaultValue: string) {

test/artifact-utils.spec.ts

+13
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,18 @@ describe('artifact-utils', () => {
3636
}),
3737
).toMatchInlineSnapshot(`"chromedriver-v1.0.1-android-ia32.zip"`);
3838
});
39+
40+
it('should return the correct hypenated artifact names for artifacts with a suffix', () => {
41+
expect(
42+
getArtifactFileName({
43+
isGeneric: false,
44+
artifactName: 'electron',
45+
version: 'v1.0.1',
46+
platform: 'darwin',
47+
arch: 'x64',
48+
artifactSuffix: 'symbols',
49+
}),
50+
).toMatchInlineSnapshot(`"electron-v1.0.1-darwin-x64-symbols.zip"`);
51+
});
3952
});
4053
});

0 commit comments

Comments
 (0)