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(()) }