From 9c1d9a68318ce2be03035f6385a1d0695dfe5caf Mon Sep 17 00:00:00 2001 From: camfairchild Date: Tue, 11 Feb 2025 20:23:53 -0500 Subject: [PATCH] use copy/remove vs fs rename --- cli/src/source.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/source.rs b/cli/src/source.rs index 4559f99bb..134cb6aaa 100644 --- a/cli/src/source.rs +++ b/cli/src/source.rs @@ -54,7 +54,8 @@ pub(crate) fn save_source_info(path: &Path, source: &Source) -> Result<()> { writer.finish()?; // Replace the original file with the patched one. - fs::rename(out_path, path)?; + fs::copy(&out_path, path)?; + fs::remove_file(&out_path)?; Ok(()) }