summaryrefslogtreecommitdiff
path: root/src/check.rs
diff options
context:
space:
mode:
authorqvkap <qvkapp@gmail.com>2026-09-05 08:29:46 +0300
committerqvkap <qvkapp@gmail.com>2026-09-05 08:29:46 +0300
commit74c76bb5cea8ff70153a8f9ebe02df6ffb0205f7 (patch)
tree7dd16b620d79f579a3ddf4da29e7a55fb585af2f /src/check.rs
parent22f9abec46c28f50df2c19b134da88848942c168 (diff)
downloadror-74c76bb5cea8ff70153a8f9ebe02df6ffb0205f7.tar.gz
ror-74c76bb5cea8ff70153a8f9ebe02df6ffb0205f7.zip
fix: dependency resolution, update file removal and sync TLS validation
Diffstat (limited to 'src/check.rs')
-rwxr-xr-xsrc/check.rs25
1 files changed, 16 insertions, 9 deletions
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()
+ );
}
}
}