Fix build error when runit service symlink already exists

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-10-23 22:15:43 +02:00
parent 80c27224e9
commit 4171e29995

View File

@@ -283,7 +283,13 @@ fn install_service(allocator: std.mem.Allocator, patch_map: PatchMap) !void {
const patched_run = try patchFile(allocator, "res/ly-runit-service/run", patch_map);
try installText(patched_run, service_dir, service_path, "run", .{ .mode = 0o755 });
try std.fs.cwd().symLink("/run/runit/supervise.ly", supervise_path, .{});
std.fs.cwd().symLink("/run/runit/supervise.ly", supervise_path, .{}) catch |err| {
if (err == error.PathAlreadyExists) {
std.debug.print("warn: /run/runit/supervise.ly already exists as a symbolic link.\n", .{});
} else {
return err;
}
};
std.debug.print("info: installed symlink /run/runit/supervise.ly\n", .{});
},
.s6 => {