╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ main.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
114 .is_terminal = true, 115 .data = .{ 116 // the files root; local routes carry no identity 117 .current_page = .{ .repo_files = .{ .name = .{} } }, 118 .is_local = true, 119 }, 120 }; 121 122 // serve the web UI in the background while the TUI runs in the 123 // foreground; the footer points at whatever port it bound. 124 const Runnable = struct { 125 io: std.Io, 126 allocator: std.mem.Allocator, 127 session: *ui.Session, 128 129 pub fn run(self: @This(), web_port: u16) !void { 130 self.session.web_port = web_port; 131 try ui.run(self.io, self.allocator, self.session, null); 132 } 133 }; 134 135 try srv.runLocal(io, allocator, local, run_opts.err, Runnable{ .io = io, .allocator = allocator, .session = &session }); 136 }, 137 .cli => |cli_cmd| switch (cli_cmd) { 138 .serve => |options| try srv.run(repo_kind, any_repo_opts, io, allocator, cwd_path, options, run_opts.err, {}), 139 }, 140 } 141 } 142