2 Commits

Author SHA1 Message Date
1b2a35509c feat: move also creates parent dir on destination
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2025-08-24 17:44:17 +02:00
6129401cb5 chore(release): v0.1.2 (#11)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.1.2

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #11
2025-08-08 14:52:40 +02:00

View File

@@ -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")?;