We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e67b236 commit 3c6a104Copy full SHA for 3c6a104
src/action/base/create_or_insert_into_file.rs
@@ -203,6 +203,13 @@ impl Action for CreateOrInsertIntoFile {
203
// that the final file goes in, so that we can rename it
204
// atomically
205
let parent_dir = path.parent().expect("File must be in a directory");
206
+ if !parent_dir.exists() {
207
+ tokio::fs::create_dir_all(&parent_dir)
208
+ .await
209
+ .map_err(|e| ActionErrorKind::CreateDirectory(parent_dir.to_owned(), e))
210
+ .map_err(Self::error)?;
211
+ }
212
+
213
let mut temp_file_path = parent_dir.to_owned();
214
{
215
let mut rng = rand::thread_rng();
0 commit comments