diff options
Diffstat (limited to 'src/storage/root.zig')
| -rw-r--r-- | src/storage/root.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/storage/root.zig b/src/storage/root.zig index bf9803e..f1a753c 100644 --- a/src/storage/root.zig +++ b/src/storage/root.zig @@ -3,10 +3,14 @@ const config = @import("../config.zig"); const prompt = @import("../prompt.zig"); pub const User = @import("user.zig"); +pub const SessionManager = @import("session-manager/root.zig"); +pub const Session = SessionManager.Session; const Self = @This(); dir: std.fs.Dir, +sessions: SessionManager = .empty, +allocator: std.mem.Allocator, pub fn init(allocator: std.mem.Allocator) !Self { const dir = std.fs.cwd().openDir(config.storage_path, .{}) catch blk: { @@ -14,7 +18,10 @@ pub fn init(allocator: std.mem.Allocator) !Self { break :blk try std.fs.cwd().openDir(config.storage_path, .{}); }; - var self = Self { .dir = dir }; + var self = Self { + .dir = dir, + .allocator = allocator, + }; dir.access("user", .{}) catch |err| switch (err) { error.FileNotFound => { |