Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl::getUbuntuVersionString): change "os" for …
Browse files Browse the repository at this point in the history
…elementary to be optional

re #735
  • Loading branch information
hasezoey committed Jan 23, 2023
1 parent 3110cb4 commit 0e90784
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
};
}

if (/^elementary\s?os\s*$/i.test(os.dist)) {
if (/^elementary(?:\s?os)?\s*$/i.test(os.dist)) {
const elementaryToUbuntuRelease: Record<number, string> = {
3: '14.04',
4: '16.04',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,26 @@ describe('MongoBinaryDownloadUrl', () => {
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.4.1.tgz'
);
});

it('should return a archive name for elementary 6.1', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '5.0.0',
// from "elementary/docker:fe08f970723a"
os: {
os: 'linux',
dist: 'elementary',
codename: 'jolnir',
release: '6.1',
id_like: ['ubuntu'],
},
});

expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.0.tgz'
);
});
});

describe('for LinuxMint', () => {
Expand Down

0 comments on commit 0e90784

Please sign in to comment.