From 74c76bb5cea8ff70153a8f9ebe02df6ffb0205f7 Mon Sep 17 00:00:00 2001 From: qvkap Date: Sat, 5 Sep 2026 08:29:46 +0300 Subject: fix: dependency resolution, update file removal and sync TLS validation --- src/check.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/check.rs') diff --git a/src/check.rs b/src/check.rs index 530814f..f7e3126 100755 --- a/src/check.rs +++ b/src/check.rs @@ -2,7 +2,7 @@ use colored::Colorize; use sha2::{Sha256, Digest}; use std::collections::HashMap; use std::fs; -use std::io::Write; +use std::io::{Write, IsTerminal}; use std::path::{Path}; use tempfile::tempdir; @@ -189,15 +189,22 @@ pub fn check_integrity(cfg: &Config) { "[ror]".yellow().bold(), broken_packages.join(", ") ); - print!("{} Reinstall them? [y/N]: ", "[ror]".blue().bold()); - std::io::stdout().flush().ok(); - let mut answer = String::new(); - std::io::stdin().read_line(&mut answer).ok(); - if answer.trim().eq_ignore_ascii_case("y") { - for pkg in broken_packages { - println!("{} Reinstalling {} ...", ">>>".cyan(), pkg); - crate::install::install_package(&pkg, cfg); + if std::io::stdin().is_terminal() { + print!("{} Reinstall them? [y/N]: ", "[ror]".blue().bold()); + std::io::stdout().flush().ok(); + let mut answer = String::new(); + std::io::stdin().read_line(&mut answer).ok(); + if answer.trim().eq_ignore_ascii_case("y") { + for pkg in broken_packages { + println!("{} Reinstalling {} ...", ">>>".cyan(), pkg); + crate::install::install_package(&pkg, cfg); + } } + } else { + eprintln!( + "{} Non-interactive mode: skipping automatic reinstall of broken packages", + "[ror]".yellow() + ); } } } -- cgit v1.2.3