Skip to content

Commit 5687952

Browse files
committed
call ensure_iggy_home() in all write_context paths
1 parent 7fca0f2 commit 5687952

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ bimap = "bimap"
3030
flate = "flate"
3131
# Valid Rust compression crate name
3232
flate2 = "flate2"
33+
# valid rust crate name
34+
writeable = "writeable"
3335
# Valid project-specific technical acronym
3436
bais = "bais"
3537
# Legitimate abbreviation for "Strategy" (e.g. pollingStrat)

core/cli/src/commands/binary_context/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ impl ContextManager {
149149
let mut new_contexts = cs.contexts.clone();
150150
new_contexts.insert(name.to_string(), config);
151151

152-
self.context_rw.ensure_iggy_home_exists().await?;
153152
self.context_rw
154153
.write_contexts(new_contexts.clone())
155154
.await
@@ -289,6 +288,7 @@ impl ContextReaderWriter {
289288
contexts_path.display()
290289
))?;
291290

291+
self.ensure_iggy_home_exists().await?;
292292
tokio::fs::write(&contexts_path, contents).await?;
293293
Self::set_owner_only_permissions(&contexts_path).await?;
294294
}
@@ -320,6 +320,7 @@ impl ContextReaderWriter {
320320
}
321321

322322
pub async fn write_active_context(&self, context_name: &str) -> Result<()> {
323+
self.ensure_iggy_home_exists().await?;
323324
let maybe_active_context_path = self.active_context_path();
324325

325326
if let Some(active_context_path) = maybe_active_context_path {

0 commit comments

Comments
 (0)