File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ export type DownloadPlatform = "macos" | "linux" ;
2+ export type DownloadArch = "aarch64" | "x86_64" ;
3+ export type DownloadFormat = "dmg" | "appimage" | "deb" ;
4+
5+ export interface DownloadLink {
6+ platform : DownloadPlatform ;
7+ arch : DownloadArch ;
8+ format : DownloadFormat ;
9+ url : string ;
10+ label : string ;
11+ }
12+
13+ export function getDownloadLinks ( version : string ) : DownloadLink [ ] {
14+ const baseUrl = `https://github.com/fastrepl/hyprnote/releases/download/desktop_v${ version } ` ;
15+
16+ return [
17+ {
18+ platform : "macos" ,
19+ arch : "aarch64" ,
20+ format : "dmg" ,
21+ url : `${ baseUrl } /hyprnote-macos-aarch64.dmg` ,
22+ label : "Apple Silicon" ,
23+ } ,
24+ {
25+ platform : "macos" ,
26+ arch : "x86_64" ,
27+ format : "dmg" ,
28+ url : `${ baseUrl } /hyprnote-macos-x86_64.dmg` ,
29+ label : "Intel" ,
30+ } ,
31+ {
32+ platform : "linux" ,
33+ arch : "x86_64" ,
34+ format : "appimage" ,
35+ url : `${ baseUrl } /hyprnote-linux-x86_64.AppImage` ,
36+ label : "AppImage" ,
37+ } ,
38+ {
39+ platform : "linux" ,
40+ arch : "x86_64" ,
41+ format : "deb" ,
42+ url : `${ baseUrl } /hyprnote-linux-x86_64.deb` ,
43+ label : "Debian" ,
44+ } ,
45+ ] ;
46+ }
47+
48+ export function groupDownloadLinks ( links : DownloadLink [ ] ) {
49+ return {
50+ macos : links . filter ( ( link ) => link . platform === "macos" ) ,
51+ linux : links . filter ( ( link ) => link . platform === "linux" ) ,
52+ } ;
53+ }
You can’t perform that action at this time.
0 commit comments