mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-04-13 09:30:06 +00:00
Fixed a bug with replacing broken symlinks
This commit is contained in:
parent
d157f48b14
commit
a98d38ce29
1 changed files with 3 additions and 3 deletions
|
@ -96,10 +96,10 @@ for my $file (keys %links) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove the destination if it exists and we were told to force an overwrite
|
# Remove the destination if it exists and we were told to force an overwrite
|
||||||
if($force && -f $dest) {
|
if($force && -d $dest) {
|
||||||
unlink($dest) || warn "Couldn't unlink '$dest': $!\n";
|
|
||||||
} elsif($force && -d $dest) {
|
|
||||||
rmtree($dest) || warn "Couldn't rmtree '$dest': $!\n";
|
rmtree($dest) || warn "Couldn't rmtree '$dest': $!\n";
|
||||||
|
} elsif($force) {
|
||||||
|
unlink($dest) || warn "Couldn't unlink '$dest': $!\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
symlink($src => $dest) ? $i++ : warn "Couldn't link '$src' to '$dest': $!\n";
|
symlink($src => $dest) ? $i++ : warn "Couldn't link '$src' to '$dest': $!\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue