Workaround for existing symlinks by overwriting them

This commit is contained in:
Jeremy Soller
2026-03-04 11:18:14 -07:00
parent 8765c51696
commit 397974cb68
+5
View File
@@ -46,6 +46,11 @@ impl crate::FileConfig {
if self.symlink {
println!("Create symlink {} to {}", target_file.display(), self.data);
if target_file.is_symlink() {
fs::remove_file(&target_file).with_context(|| {
format!("failed to remove old symlink {}", target_file.display())
})?;
}
symlink(&OsStr::new(&self.data), &target_file).with_context(|| {
format!(
"failed to create symlink {} to {}",