From a6a4f9ff8eb908597844980febb106c6e02421d1 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Tue, 24 Sep 2024 10:28:49 -0500 Subject: [PATCH] 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. --- src/cli/list_themes.zig | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cli/list_themes.zig b/src/cli/list_themes.zig index dd812d5ca..d512dcc03 100644 --- a/src/cli/list_themes.zig +++ b/src/cli/list_themes.zig @@ -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; - 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), - }); + 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 => {}, + } } }