Skip to content

Commit

Permalink
fix: proper symlink check order
Browse files Browse the repository at this point in the history
if path is symlink to non-existent file path.isDir raises
std.file.FileException: No such file or directory
  • Loading branch information
kucaahbe committed Jan 31, 2024
1 parent f285568 commit 97c78cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/cli.d
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ private void printStatus1(ref Config app_config)
} else {
output ~= " # ";
if (symlink.destination.exists) {
if (symlink.destination.isDir) {
output ~= "is a directory";
} else if (symlink.destination.isSymlink) {
if (symlink.destination.isSymlink) {
output ~= "-> ";
output ~= symlink.actual.absolute;
} else if (symlink.destination.isDir) {
output ~= "is a directory";
}
} else {
output ~= "no such file or directory";
Expand Down

0 comments on commit 97c78cc

Please sign in to comment.