add special case for tar.gz packages, call them tgz

Resolves: https://github.com/status-im/status-desktop/issues/2662

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-08-16 19:29:57 +02:00
parent 9530b5214e
commit 0dd5915fd8
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 8 additions and 5 deletions

View File

@ -17,6 +17,8 @@ const fileExt = (data) => {
let ext = 'pkg' /* generic option for unexpected situations */
if (data.includes('diawi')) {
ext = 'ipa' /* diawi urls don't contain file extension */
} else if (data.endsWith('tar.gz')) {
ext = 'tgz' /* three-letter extensions just look nicer */
} else if (data.match(/^https?:\/\/.+\/[^.]+\.(\w{3,8})$/)) {
ext = data.split('.').pop()
}

View File

@ -35,12 +35,12 @@ const COMMENT_FOLDED = `
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result |
|-|-|-|-|-|-|-|
| :heavy_check_mark: | COMMIT-2 | [ID-8](URL-8/) | 2018-12-20 08:32:34 | DURATION-8 | \`PLATFORM-8\` | [:package:\`apk\`](https://example.org/StatusIm-123-456-abc-pr.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fexample.org%2FStatusIm-123-456-abc-pr.apk)|
| :heavy_multiplication_x: | COMMIT-2 | [ID-9](URL-9/) | 2018-12-20 08:33:31 | DURATION-9 | \`PLATFORM-9\` | [:package:\`exe\`](https://example.org/StatusIm-123-456-abc-pr.exe) |
| :interrobang: | COMMIT-2 | [ID-10](URL-10/) | 2018-12-20 08:34:27 | DURATION-10 | \`PLATFORM-10\` | [:page_facing_up:\`log\`](URL-10/consoleText) |
| :heavy_check_mark: | COMMIT-2 | [ID-11](URL-11/) | 2018-12-20 08:35:24 | DURATION-11 | \`PLATFORM-11\` | [:package:\`App\`](https://example.org/StatusIm-123-456-abc-pr.AppImage) |
| :heavy_check_mark: | COMMIT-2 | [ID-8](URL-8/) | 2018-12-20 08:32:34 | DURATION-8 | \`PLATFORM-8\` | [:package:\`tgz\`](https://example.org/StatusIm-123-456-abc-pr.tar.gz) |
| :heavy_multiplication_x: | COMMIT-2 | [ID-9](URL-9/) | 2018-12-20 08:33:31 | DURATION-9 | \`PLATFORM-9\` | [:package:\`apk\`](https://example.org/StatusIm-123-456-abc-pr.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fexample.org%2FStatusIm-123-456-abc-pr.apk)|
| :heavy_check_mark: | COMMIT-2 | [ID-10](URL-10/) | 2018-12-20 08:34:27 | DURATION-10 | \`PLATFORM-10\` | [:package:\`exe\`](https://example.org/StatusIm-123-456-abc-pr.exe) |
| :interrobang: | COMMIT-2 | [ID-11](URL-11/) | 2018-12-20 08:35:24 | DURATION-11 | \`PLATFORM-11\` | [:page_facing_up:\`log\`](URL-11/consoleText) |
| | | | | | | |
| :heavy_multiplication_x: | COMMIT-3 | [ID-12](URL-12/) | 2018-12-20 08:36:21 | DURATION-12 | \`PLATFORM-12\` | [:package:\`ipa\`](https://i.diawi.com/ABCDxyz1) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fi.diawi.com%2FABCDxyz1)|
| :heavy_multiplication_x: | COMMIT-3 | [ID-12](URL-12/) | 2018-12-20 08:36:21 | DURATION-12 | \`PLATFORM-12\` | [:package:\`App\`](https://example.org/StatusIm-123-456-abc-pr.AppImage) |
`
describe('Comments', () => {

View File

@ -6,6 +6,7 @@ const PKG_URLS = [
'https://i.diawi.com/ABCDxyz1',
'https://unknown.example.org/path/package',
null,
'https://example.org/StatusIm-123-456-abc-pr.tar.gz',
]
/* example valid build */