Skip to content

Commit

Permalink
fix: remove FileLoader symlink unconditionally (#762)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
This PR modifies the FileLoader to remove the hash symlink
unconditionally, whether broken or not. This should fix an issue where
the symlink exists, points to another symlink, and that is a dead link.

### What kind of change does this PR introduce?
- [x] Bug fix (issue: permission denied error)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
No.
  • Loading branch information
wdconinc authored Jul 25, 2024
1 parent e601d46 commit e1dfc99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FileLoaderHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ inline void EnsureFileFromURLExists(std::string url, std::string file, std::stri
return;
}

if (fs::exists(fs::symlink_status(hash_path)) && !fs::exists(fs::status(hash_path))) {
printout(INFO, "FileLoader", "removing broken \"" + hash_path.string() + "\" symlink");
if (fs::exists(fs::symlink_status(hash_path))) {
printout(INFO, "FileLoader", "removing symlink \"" + hash_path.string() + "\"");
remove(hash_path);
}

Expand Down

0 comments on commit e1dfc99

Please sign in to comment.