This is an automated email from the ASF dual-hosted git repository.

hgruszecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new f2dbabdcc fix(cli): Ensure home directory exists when writing contexts 
(#3069)
f2dbabdcc is described below

commit f2dbabdcc47bcdbb8660a6d7bad43f2534e0837f
Author: Paul Iyobo <[email protected]>
AuthorDate: Tue Apr 14 10:56:10 2026 +0200

    fix(cli): Ensure home directory exists when writing contexts (#3069)
---
 core/cli/src/commands/binary_context/common.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/cli/src/commands/binary_context/common.rs 
b/core/cli/src/commands/binary_context/common.rs
index 09009b7ef..c0432a6ff 100644
--- a/core/cli/src/commands/binary_context/common.rs
+++ b/core/cli/src/commands/binary_context/common.rs
@@ -149,7 +149,6 @@ impl ContextManager {
         let mut new_contexts = cs.contexts.clone();
         new_contexts.insert(name.to_string(), config);
 
-        self.context_rw.ensure_iggy_home_exists().await?;
         self.context_rw
             .write_contexts(new_contexts.clone())
             .await
@@ -289,6 +288,7 @@ impl ContextReaderWriter {
                 contexts_path.display()
             ))?;
 
+            self.ensure_iggy_home_exists().await?;
             tokio::fs::write(&contexts_path, contents).await?;
             Self::set_owner_only_permissions(&contexts_path).await?;
         }
@@ -320,6 +320,7 @@ impl ContextReaderWriter {
     }
 
     pub async fn write_active_context(&self, context_name: &str) -> Result<()> 
{
+        self.ensure_iggy_home_exists().await?;
         let maybe_active_context_path = self.active_context_path();
 
         if let Some(active_context_path) = maybe_active_context_path {

Reply via email to