feat: links to folders open as folders, on machines and SSH hosts, with their own icon; deleting a link leaves what it leads to

This commit is contained in:
redtea committed 2026-10-16 09:34:32 +03:00
1 parent 4da1cc4200
commit 055020c3bb
6 files changed
+60 -7

No files matched your search

+10 -2
View File
@@ -114,13 +114,21 @@ func fsList(path string) (proto.FSListResult, error) {
if err != nil {
continue
}
out = append(out, proto.FSEntry{
ent := proto.FSEntry{
Name: e.Name(),
IsDir: e.IsDir(),
Size: info.Size(),
Mode: info.Mode().String(),
MTime: info.ModTime().Unix(),
})
}
// A link to a folder opens like one.
if info.Mode()&os.ModeSymlink != 0 {
ent.Link = true
if t, err := os.Stat(filepath.Join(abs, e.Name())); err == nil && t.IsDir() {
ent.IsDir = true
}
}
out = append(out, ent)
}
// Directories first, then alphabetical.
sort.Slice(out, func(i, j int) bool {