diff --git a/src/helpers.js b/src/helpers.js index d48c7c5..e0e4b82 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -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() } diff --git a/test/comments.js b/test/comments.js index 9c85964..844bdab 100644 --- a/test/comments.js +++ b/test/comments.js @@ -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', () => { diff --git a/test/sample.js b/test/sample.js index fc5b20f..b12321a 100644 --- a/test/sample.js +++ b/test/sample.js @@ -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 */