mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Implement custom session support (fixes #757)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
14
build.zig
14
build.zig
@@ -135,6 +135,12 @@ fn install_ly(allocator: std.mem.Allocator, patch_map: PatchMap, install_config:
|
||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_config_directory});
|
||||
};
|
||||
|
||||
const ly_custom_sessions_directory = try std.fs.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/custom-sessions" });
|
||||
|
||||
std.fs.cwd().makePath(ly_custom_sessions_directory) catch {
|
||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_custom_sessions_directory});
|
||||
};
|
||||
|
||||
const ly_lang_path = try std.fs.path.join(allocator, &[_][]const u8{ dest_directory, config_directory, "/ly/lang" });
|
||||
std.fs.cwd().makePath(ly_lang_path) catch {
|
||||
std.debug.print("warn: {s} already exists as a directory.\n", .{ly_lang_path});
|
||||
@@ -167,6 +173,14 @@ fn install_ly(allocator: std.mem.Allocator, patch_map: PatchMap, install_config:
|
||||
try installText(patched_setup, config_dir, ly_config_directory, "setup.sh", .{ .mode = 0o755 });
|
||||
}
|
||||
|
||||
{
|
||||
var custom_sessions_dir = std.fs.cwd().openDir(ly_custom_sessions_directory, .{}) catch unreachable;
|
||||
defer custom_sessions_dir.close();
|
||||
|
||||
const patched_readme = try patchFile(allocator, "res/custom-sessions/README", patch_map);
|
||||
try installText(patched_readme, custom_sessions_dir, ly_custom_sessions_directory, "README", .{});
|
||||
}
|
||||
|
||||
{
|
||||
var lang_dir = std.fs.cwd().openDir(ly_lang_path, .{}) catch unreachable;
|
||||
defer lang_dir.close();
|
||||
|
||||
Reference in New Issue
Block a user