diff --git a/.typos.toml b/.typos.toml index bf6e17ec9..61479c278 100644 --- a/.typos.toml +++ b/.typos.toml @@ -30,6 +30,8 @@ bimap = "bimap" flate = "flate" # Valid Rust compression crate name flate2 = "flate2" +# valid rust crate name +writeable = "writeable" # Valid project-specific technical acronym bais = "bais" # Legitimate abbreviation for "Strategy" (e.g. pollingStrat) 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 {