mirror of
https://github.com/Dummi26/rembackup.git
synced 2025-07-16 21:13:37 +02:00
allow index symlinks to change
This commit is contained in:
parent
a742bffddc
commit
5ac3d9aee0
@ -203,12 +203,12 @@ pub fn apply_indexchanges_int(
|
||||
if let Err(e) = std::env::set_current_dir(&p) {
|
||||
eprintln!("\n[warn] couldn't cd to {p:?}: {e}");
|
||||
} else {
|
||||
if let Err(e) = std::os::unix::fs::symlink(
|
||||
link_target,
|
||||
index_file
|
||||
.file_name()
|
||||
.expect("a file should always have a filename"),
|
||||
) {
|
||||
let index_file_name = index_file
|
||||
.file_name()
|
||||
.expect("a file should always have a filename");
|
||||
let _ = std::fs::remove_file(&index_file_name);
|
||||
if let Err(e) = std::os::unix::fs::symlink(link_target, index_file_name)
|
||||
{
|
||||
eprintln!(
|
||||
"\n[warn] couldn't set index file {index_file:?} to be a symlink to {link_target:?}: {e}"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user