cli: list-themes should list symlinks

Symbolic links should be listed in addition to normal files. Useful
for system like home-manager that link config files to location in the
Nix store.
This commit is contained in:
Jeffrey C. Ollie
2024-09-24 10:28:49 -05:00
committed by Mitchell Hashimoto
parent 743e547235
commit a6a4f9ff8e

View File

@ -114,13 +114,17 @@ pub fn run(gpa_alloc: std.mem.Allocator) !u8 {
var walker = dir.iterate();
while (try walker.next()) |entry| {
if (entry.kind != .file) continue;
switch (entry.kind) {
.file, .sym_link => {
count += 1;
try themes.append(.{
.location = loc.location,
.path = try std.fs.path.join(alloc, &.{ loc.dir, entry.name }),
.theme = try alloc.dupe(u8, entry.name),
});
},
else => {},
}
}
}