From 75577c65c03052748473cd44cc4f958b7004b483 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 17 Oct 2024 18:41:25 +0200 Subject: [PATCH] Make `sq --home=default` work. - Home::new(None) doesn't select the default location, it honors SEQUOIA_HOME. --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 36fc04bf..179c2ba2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -223,8 +223,14 @@ fn main() -> Result<()> { policy: &policy, time, time_is_now, - home: sequoia_directories::Home::new( - c.home.as_ref().and_then(|a| a.path()))?, + home: if let Some(p) = c.home.as_ref().and_then(|a| a.path()) { + sequoia_directories::Home::new(p)? + } else { + sequoia_directories::Home::default() + .ok_or(anyhow::anyhow!("no default SEQUOIA_HOME \ + on this platform"))? + .clone() + }, no_rw_cert_store: c.no_cert_store, cert_store_path: c.cert_store.as_ref().and_then(|a| a.path()), pep_cert_store_path: c.pep_cert_store.clone(),