feat: v1.9.8

This commit is contained in:
2025-08-24 12:34:25 +08:00
parent b91b29e22d
commit b94acf9c31
5 changed files with 100 additions and 69 deletions

View File

@@ -1,4 +1,4 @@
use std::env;
use std::{env, fs};
use rust_util::util_env as rust_util_env;
use rust_util::{debugging, util_env, warning};
@@ -43,6 +43,16 @@ pub fn get_gpg_cmd() -> Option<String> {
env::var(TINY_ENCRYPT_ENV_GPG_COMMAND).ok()
}
pub fn get_default_pin_entry() -> Option<String> {
let default_pin_entry = "/usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac";
if let Ok(meta) = fs::metadata(default_pin_entry) {
if meta.is_file() {
return Some(default_pin_entry.to_string());
}
}
get_pin_entry()
}
pub fn get_pin_entry() -> Option<String> {
env::var(TINY_ENCRYPT_ENV_PIN_ENTRY).ok()
}