Compare commits
2 Commits
a65190ef9d
...
main
Author | SHA1 | Date | |
---|---|---|---|
1b2a35509c
|
|||
6129401cb5 |
@@ -328,6 +328,14 @@ pub async fn apply(input: &str, options: ApplyOptions) -> anyhow::Result<()> {
|
|||||||
anyhow::bail!("destination already exists cannot move");
|
anyhow::bail!("destination already exists cannot move");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(parent) = existing.path.parent()
|
||||||
|
&& !parent.exists()
|
||||||
|
{
|
||||||
|
tokio::fs::create_dir_all(&parent)
|
||||||
|
.await
|
||||||
|
.context("failed to create dest for move")?;
|
||||||
|
}
|
||||||
|
|
||||||
tokio::fs::rename(&existing.path, path)
|
tokio::fs::rename(&existing.path, path)
|
||||||
.await
|
.await
|
||||||
.context("move path")?;
|
.context("move path")?;
|
||||||
|
Reference in New Issue
Block a user