Skip to content

Commit

Permalink
Create parent dir if it does not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv committed Dec 3, 2024
1 parent a756349 commit 7094495
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swiftide-agents/src/tools/local_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ impl LocalExecutor {
}

async fn exec_write_file(&self, path: &Path, content: &str) -> Result<CommandOutput> {
if let Some(parent) = path.parent() {
let _ = tokio::fs::create_dir_all(parent).await;
}
tokio::fs::write(path, content).await?;

Ok(CommandOutput::Ok)
Expand Down

0 comments on commit 7094495

Please sign in to comment.