Skip to content

Commit

Permalink
Add OneDrive lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Scotsguy committed Jan 11, 2020
1 parent 2236762 commit e5bd1de
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ use regex::Regex;

pub type Check = fn(&str) -> Option<(&str, String)>;

pub static PARSERS: [Check; 8] = [
pub static PARSERS: [Check; 9] = [
multimc_in_program_files,
server_java,
buildsystem_forge,
multimc_in_onedrive_managed_folder,
java_version,
id_range_exceeded,
out_of_memory_error,
Expand Down Expand Up @@ -79,6 +80,17 @@ fn out_of_memory_error(log: &str) -> Option<(&str, String)> {
}
}

fn multimc_in_onedrive_managed_folder(log: &str) -> Option<(&str, String)> {
lazy_static! {
static ref RE: Regex = Regex::new(r"Minecraft folder is:\nC:/.+/.+/OneDrive").unwrap();
}
if RE.is_match(log) {
Some(("❗", "MultiMC is located in a folder managed by OneDrive. OneDrive messes with Minecraft folders while the game is running, and this often leads to crashes.\nYou should move MultiMC to a different folder.".to_string()))
} else {
None
}
}

fn java_version(log: &str) -> Option<(&str, String)> {
lazy_static! {
static ref RE: Regex =
Expand Down

0 comments on commit e5bd1de

Please sign in to comment.