@@ -14,6 +14,15 @@ use std::{env::current_exe, process::exit};
1414
1515/// The GitHub repository to use for releases
1616pub const GITHUB_REPOSITORY : & str = "PocketRelay/Client" ;
17+ // Windows non native asset name
18+ #[ cfg( all( target_family = "windows" , not( feature = "native" ) ) ) ]
19+ pub const ASSET_NAME : & str = "pocket-relay-client.exe" ;
20+ // Windows native asset name
21+ #[ cfg( all( target_family = "windows" , feature = "native" ) ) ]
22+ pub const ASSET_NAME : & str = "pocket-relay-client-native.exe" ;
23+ // Linux asset name
24+ #[ cfg( target_family = "unix" ) ]
25+ pub const ASSET_NAME : & str = "pocket-relay-client-linux" ;
1726
1827/// Handles the updating process
1928pub async fn update ( http_client : reqwest:: Client ) {
@@ -74,22 +83,10 @@ pub async fn update(http_client: reqwest::Client) {
7483
7584 debug ! ( "New version is available ({})" , latest_version) ;
7685
77- // Windows non native asset name
78- #[ cfg( all( target_family = "windows" , not( feature = "native" ) ) ) ]
79- let asset_name = "pocket-relay-client.exe" ;
80-
81- // Windows native asset name
82- #[ cfg( all( target_family = "windows" , feature = "native" ) ) ]
83- let asset_name = "pocket-relay-client-native.exe" ;
84-
85- // Linux asset name
86- #[ cfg( target_family = "unix" ) ]
87- let asset_name = "pocket-relay-client-linux" ;
88-
8986 let asset = match latest_release
9087 . assets
9188 . iter ( )
92- . find ( |asset| asset. name == asset_name )
89+ . find ( |asset| asset. name == ASSET_NAME )
9390 {
9491 Some ( value) => value,
9592 None => {
0 commit comments