Skip to content

Commit

Permalink
fix: actually use the artifactSuffix when generating the filename (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and malept committed Jul 24, 2019
1 parent 7c8b45b commit 52d9c0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/artifact-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export function getArtifactFileName(

ensureIsTruthyString(details, 'platform');
ensureIsTruthyString(details, 'arch');
return `${[details.artifactName, details.version, details.platform, details.arch].join('-')}.zip`;
return `${[
details.artifactName,
details.version,
details.platform,
details.arch,
...(details.artifactSuffix ? [details.artifactSuffix] : []),
].join('-')}.zip`;
}

function mirrorVar(name: keyof MirrorOptions, options: MirrorOptions, defaultValue: string) {
Expand Down
13 changes: 13 additions & 0 deletions test/artifact-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,18 @@ describe('artifact-utils', () => {
}),
).toMatchInlineSnapshot(`"chromedriver-v1.0.1-android-ia32.zip"`);
});

it('should return the correct hypenated artifact names for artifacts with a suffix', () => {
expect(
getArtifactFileName({
isGeneric: false,
artifactName: 'electron',
version: 'v1.0.1',
platform: 'darwin',
arch: 'x64',
artifactSuffix: 'symbols',
}),
).toMatchInlineSnapshot(`"electron-v1.0.1-darwin-x64-symbols.zip"`);
});
});
});

0 comments on commit 52d9c0e

Please sign in to comment.