chore: cleanup

This commit is contained in:
iff 2025-04-10 17:42:01 +02:00
parent f9b8ee44f2
commit 49dcbea59e
2 changed files with 11 additions and 12 deletions

View file

@ -28,6 +28,12 @@ async fn main() -> Result<(), std::io::Error> {
if std::env::var("_PR_AI_DISABLE").is_ok() {
return Ok(());
}
let mode = std::env::var("_PR_MODE");
if let Ok(mode) = mode {
if mode.as_str() == "noconfirm" {
return Ok(());
}
}
let locale = {
let sys_locale = get_locale().unwrap_or("en-US".to_string());
@ -39,13 +45,6 @@ async fn main() -> Result<(), std::io::Error> {
};
rust_i18n::set_locale(&locale[0..2]);
let mode = std::env::var("_PR_MODE");
if let Ok(mode) = mode {
if mode.as_str() == "noconfirm" {
return Ok(());
}
}
let command = std::env::var("_PR_LAST_COMMAND").expect("_PR_LAST_COMMAND not set");
let error = std::env::var("_PR_ERROR_MSG").expect("_PR_ERROR_MSG not set");
colored::control::set_override(true);