aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-tauri/src/lib.rs28
-rw-r--r--src-tauri/src/main.rs2
-rw-r--r--src-tauri/src/repair_and_verify/mod.rs28
3 files changed, 29 insertions, 29 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index ff923cb1..fbef3bac 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -321,34 +321,6 @@ pub fn convert_release_candidate_number(version_number: String) -> String {
version_number.replace("-rc", "0").replace("00", "")
}
-pub fn get_log_list(game_install: GameInstall) -> Result<Vec<std::path::PathBuf>, String> {
- let ns_log_folder = format!("{}/R2Northstar/logs", game_install.game_path);
-
- // Check if logs folder exists
- if !std::path::Path::new(&ns_log_folder).exists() {
- return Err("No logs folder found".to_string());
- }
-
- // List files in logs folder
- let paths = std::fs::read_dir(ns_log_folder).unwrap();
-
- // Stores paths of log files
- let mut log_files: Vec<std::path::PathBuf> = Vec::new();
-
- for path in paths {
- let path = path.unwrap().path();
- if path.display().to_string().contains("nslog") {
- log_files.push(path);
- }
- }
-
- if log_files.len() > 0 {
- Ok(log_files)
- } else {
- Err("No logs found".to_string())
- }
-}
-
/// Returns a serde json object of the parsed `enabledmods.json` file
pub fn get_enabled_mods(game_install: GameInstall) -> Result<serde_json::value::Value, String> {
let enabledmods_json_path = format!(
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index b8b1ac3e..d775d978 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -15,7 +15,7 @@ mod github;
use github::release_notes::{get_northstar_release_notes, check_is_flightcore_outdated};
mod repair_and_verify;
-use repair_and_verify::{clean_up_download_folder, disable_all_but_core, verify_game_files};
+use repair_and_verify::{clean_up_download_folder, disable_all_but_core, verify_game_files, get_log_list};
mod mod_management;
use mod_management::{
diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs
index 188d3821..32715622 100644
--- a/src-tauri/src/repair_and_verify/mod.rs
+++ b/src-tauri/src/repair_and_verify/mod.rs
@@ -65,3 +65,31 @@ pub fn clean_up_download_folder(
Ok(())
}
+
+pub fn get_log_list(game_install: GameInstall) -> Result<Vec<std::path::PathBuf>, String> {
+ let ns_log_folder = format!("{}/R2Northstar/logs", game_install.game_path);
+
+ // Check if logs folder exists
+ if !std::path::Path::new(&ns_log_folder).exists() {
+ return Err("No logs folder found".to_string());
+ }
+
+ // List files in logs folder
+ let paths = std::fs::read_dir(ns_log_folder).unwrap();
+
+ // Stores paths of log files
+ let mut log_files: Vec<std::path::PathBuf> = Vec::new();
+
+ for path in paths {
+ let path = path.unwrap().path();
+ if path.display().to_string().contains("nslog") {
+ log_files.push(path);
+ }
+ }
+
+ if log_files.len() > 0 {
+ Ok(log_files)
+ } else {
+ Err("No logs found".to_string())
+ }
+}