Skip to content

Commit

Permalink
Merge pull request #75 from rust-cross/remove-broken-symlink
Browse files Browse the repository at this point in the history
Remove broken symlink before creating new one
  • Loading branch information
messense authored Dec 26, 2022
2 parents 0c658ea + 462b5ff commit e76deb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ fn symlink_wrapper(target: &Path) -> Result<()> {
#[cfg(unix)]
{
if !target.exists() {
if fs::read_link(target).is_ok() {
// remove broken symlink
fs::remove_file(target)?;
}
std::os::unix::fs::symlink(current_exe, target)?;
}
}
Expand Down

0 comments on commit e76deb1

Please sign in to comment.