Skip to content

Commit

Permalink
Clean no-verbose ui
Browse files Browse the repository at this point in the history
  • Loading branch information
AOx0 committed Jul 19, 2022
1 parent 0163138 commit a075530
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
4 changes: 3 additions & 1 deletion src/async_installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pub async fn install<T: InstallingOptions>(args: T, mods: &[&str], installer: In
let install_message = Installer::gen_install_string(&mods);
let steamcmd = installer.get_steamcmd_path();

log!( Status: "Spawning SteamCMD");
if args.is_verbose(){
log!( Status: "Spawning SteamCMD");
}


#[cfg(target_os = "windows")]
Expand Down
33 changes: 15 additions & 18 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub async fn install(
continue;
}

if args.verbose {
if args.is_verbose() {
log!(Status: "Adding {} to queue", m);
}

Expand All @@ -108,7 +108,7 @@ pub async fn install(
continue;
}

if args.verbose {
if args.is_verbose() {
log!(Status: "Adding {} to queue", id);
}

Expand Down Expand Up @@ -204,7 +204,7 @@ pub async fn install(
}
}
} else {
if !inline || args.verbose {
if !inline || args.is_verbose() {
log!( Error: "No results found for {}", m);
}

Expand All @@ -217,7 +217,7 @@ pub async fn install(

if d == 0 {
log!( Status:
"Installing mod{}...",
"Installing mod{}",
if args.r#mod.len() > 1 { "s" } else { "" },
)
};
Expand Down Expand Up @@ -322,7 +322,9 @@ pub async fn install(
result
};

log!(Status: "Installer finished");
if args.is_verbose() {
log!(Status: "Installer finished");
}

{
let mut should_end = should_end.lock().unwrap();
Expand All @@ -347,10 +349,12 @@ pub async fn install(

let destination = rim_install.path().join("Mods");

log!( Status:
"Handling & moving mods to \"{}\"",
destination.to_str().unwrap_or("error")
);
if args.is_verbose() {
log!( Status:
"Handling & moving mods to \"{}\"",
destination.to_str().unwrap_or("error")
);
}

let mut ids: HashSet<String> = ids.iter().map(|s| s.to_string()).collect();

Expand Down Expand Up @@ -449,7 +453,7 @@ pub async fn install(
log!(Warning: "Did not install {:?}", ids);
}

if d == 0 {
if d == 0 && args.is_verbose() {
log!(Status: "Done!");
};

Expand All @@ -466,14 +470,7 @@ pub async fn install(
if d == 0 {
clear_leftlovers(&path_downloads, &args);
clear_leftlovers(&PathBuf::from(PATH), &args);
log!(Status: "Done!");

if !ids.is_empty() {
log!(Warning: "Trying to install failed ids {:?}", ids);
args.r#mod = ids.iter().map(|s| s.to_string()).collect::<Vec<String>>();
install(args.clone(), i.clone(), d + 1, already_installed.clone()).await;
}

log!(Status: "Done!");
};
}
}

0 comments on commit a075530

Please sign in to comment.