╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ main.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
135 .color = run_opts.color, 136 .data = .{ 137 // the files root; local routes carry no identity 138 .current_page = .{ .repo_files = .{ .name = .{} } }, 139 .host_kind = .local, 140 }, 141 }; 142 143 // serve the web UI in the background while the TUI runs in the 144 // foreground; the footer points at whatever port it bound. 145 const Runnable = struct { 146 io: std.Io, 147 allocator: std.mem.Allocator, 148 session: *ui.Session, 149 150 pub fn run(self: @This(), web_url: []const u8) !void { 151 self.session.web_url = web_url; 152 try ui.run(self.io, self.allocator, self.session, null); 153 } 154 }; 155 156 try srv.runLocal(io, allocator, local, run_opts.err, Runnable{ .io = io, .allocator = allocator, .session = &session }); 157 }, 158 .cli => |cli_cmd| switch (cli_cmd) { 159 .serve => |options| try srv.run(repo_kind, any_repo_opts, io, allocator, cwd_path, options, run_opts.err, {}), 160 }, 161 } 162 } 163