aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-09 17:04:07 +0200
committerGitHub <noreply@github.com>2023-05-09 17:04:07 +0200
commit3f759690c18f770ef70cb483969094e5ef3f52b9 (patch)
treedde38d17283a97ae617a3bf8df2c3528c4430dda
parentbba2be3d9c7529cef55603a77f67dee0091ad68c (diff)
downloadFlightCore-3f759690c18f770ef70cb483969094e5ef3f52b9.tar.gz
FlightCore-3f759690c18f770ef70cb483969094e5ef3f52b9.zip
refactor: Move `convert_release_candidate_number` to `main.rs` (#334)
Part of #329
-rw-r--r--src-tauri/src/lib.rs9
-rw-r--r--src-tauri/src/main.rs9
2 files changed, 9 insertions, 9 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index a6254a99..e570efdf 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -496,12 +496,3 @@ pub fn check_northstar_running() -> bool {
|| s.processes_by_name("Titanfall2.exe").next().is_some();
x
}
-
-/// Helps with converting release candidate numbers which are different on Thunderstore
-/// due to restrictions imposed by the platform
-pub fn convert_release_candidate_number(version_number: String) -> String {
- // This simply converts `-rc` to `0`
- // Works as intended for RCs < 10, e.g. `v1.9.2-rc1` -> `v1.9.201`
- // Doesn't work for larger numbers, e.g. `v1.9.2-rc11` -> `v1.9.2011` (should be `v1.9.211`)
- version_number.replace("-rc", "0").replace("00", "")
-}
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 6f1ad59c..abaff219 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -248,6 +248,15 @@ async fn get_northstar_version_number_caller(game_path: String) -> Result<String
}
}
+/// Helps with converting release candidate numbers which are different on Thunderstore
+/// due to restrictions imposed by the platform
+pub fn convert_release_candidate_number(version_number: String) -> String {
+ // This simply converts `-rc` to `0`
+ // Works as intended for RCs < 10, e.g. `v1.9.2-rc1` -> `v1.9.201`
+ // Doesn't work for larger numbers, e.g. `v1.9.2-rc11` -> `v1.9.2011` (should be `v1.9.211`)
+ version_number.replace("-rc", "0").replace("00", "")
+}
+
/// Checks if installed Northstar version is up-to-date
/// false -> Northstar install is up-to-date
/// true -> Northstar install is outdated