11---
2- import { Icon } from ' astro-icon/components' ;
3- import { format } from ' date-fns' ;
4- import { Octokit } from ' octokit' ;
5- import DownloadButton from ' ~/components/DownloadButton.astro' ;
6- import { siteMetadata , URLs } from ' ~/constants' ;
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+ import { Icon } from " astro-icon/components" ;
34+ import { format } from " date-fns" ;
35+ import { Octokit } from " octokit" ;
36+ import DownloadButton from " ~/components/DownloadButton.astro" ;
37+ import { siteMetadata , URLs } from " ~/constants" ;
738import type {
839 DownloadLink ,
940 DownloadLinks ,
1041 HeroData ,
1142 ReleaseAsset ,
12- } from ' ~/types' ;
43+ } from " ~/types" ;
1344
1445const octokit = new Octokit ();
1546
@@ -21,41 +52,41 @@ const getDownloadLinks = (assets: ReleaseAsset[]): DownloadLinks => {
2152
2253 const supportedOSs: DownloadLink [] = [
2354 {
24- os: ' macOS' ,
25- name: ' macOS (Universal)' ,
55+ os: " macOS" ,
56+ name: " macOS (Universal)" ,
2657 url: getAssetLink (/ Gitify-\d + .\d + .\d + -universal. dmg/ g ),
2758 isPrimary: true ,
2859 },
2960 {
30- os: ' Windows' ,
31- name: ' Windows' ,
61+ os: " Windows" ,
62+ name: " Windows" ,
3263 url: getAssetLink (/ Gitify-Setup-\d + .\d + .\d + . exe/ g ),
3364 isPrimary: true ,
3465 },
3566 {
36- os: ' Linux' ,
37- name: ' Linux (AppImage)' ,
67+ os: " Linux" ,
68+ name: " Linux (AppImage)" ,
3869 url: getAssetLink (/ Gitify-\d + .\d + .\d + . AppImage/ g ),
3970 isPrimary: true ,
4071 },
4172 {
42- os: ' Linux' ,
43- name: ' Linux (deb)' ,
73+ os: " Linux" ,
74+ name: " Linux (deb)" ,
4475 url: getAssetLink (/ gitify_\d + .\d + .\d + _amd64. deb/ g ),
4576 },
4677 {
47- os: ' Linux' ,
48- name: ' Linux (rpm)' ,
78+ os: " Linux" ,
79+ name: " Linux (rpm)" ,
4980 url: getAssetLink (/ gitify-\d + .\d + .\d + . x86_64. rpm/ g ),
5081 },
5182 ];
5283
5384 const primaryDownloadLinks = supportedOSs .filter (
54- ({ isPrimary , url }) => url && isPrimary ,
85+ ({ isPrimary , url }) => url && isPrimary
5586 );
5687
5788 const altDownloadLinks = supportedOSs .filter (
58- ({ isPrimary , url }) => url && ! isPrimary ,
89+ ({ isPrimary , url }) => url && ! isPrimary
5990 );
6091
6192 return {
@@ -79,17 +110,17 @@ const loadInitialData = async (): Promise<HeroData> => {
79110 downloadLinks ,
80111 version: latestRelease .data .name ,
81112 releaseDate: latestRelease .data .published_at
82- ? format (latestRelease .data .published_at , ' dd/MM/yyyy' )
83- : ' ' ,
113+ ? format (latestRelease .data .published_at , " dd/MM/yyyy" )
114+ : " " ,
84115 };
85116 } catch (error ) {
86117 return {
87118 downloadLinks: {
88119 alt: [],
89120 primary: [],
90121 },
91- version: ' ' ,
92- releaseDate: ' ' ,
122+ version: " " ,
123+ releaseDate: " " ,
93124 };
94125 }
95126};
0 commit comments