From 87503367e9ca5937ccbf34b4f5c532422657aa50 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Wed, 5 Mar 2025 22:36:17 +0100 Subject: [PATCH] Try to create /etc/pam.d and /usr/bin everytime when installing Signed-off-by: AnErrupTion --- build.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build.zig b/build.zig index 9ea68bf..5984a45 100644 --- a/build.zig +++ b/build.zig @@ -232,11 +232,11 @@ fn install_ly(allocator: std.mem.Allocator, install_config: bool) !void { { const exe_path = try std.fs.path.join(allocator, &[_][]const u8{ dest_directory, prefix_directory, "/bin" }); - if (!std.mem.eql(u8, dest_directory, "")) { - std.fs.cwd().makePath(exe_path) catch { + std.fs.cwd().makePath(exe_path) catch { + if (!std.mem.eql(u8, dest_directory, "")) { std.debug.print("warn: {s} already exists as a directory.\n", .{exe_path}); - }; - } + } + }; var executable_dir = std.fs.cwd().openDir(exe_path, .{}) catch unreachable; defer executable_dir.close(); @@ -295,11 +295,11 @@ fn install_ly(allocator: std.mem.Allocator, install_config: bool) !void { { const pam_path = try std.fs.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/pam.d" }); - if (!std.mem.eql(u8, dest_directory, "")) { - std.fs.cwd().makePath(pam_path) catch { + std.fs.cwd().makePath(pam_path) catch { + if (!std.mem.eql(u8, dest_directory, "")) { std.debug.print("warn: {s} already exists as a directory.\n", .{pam_path}); - }; - } + } + }; var pam_dir = std.fs.cwd().openDir(pam_path, .{}) catch unreachable; defer pam_dir.close();