╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ try.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
228 \\ git add hello.txt 229 \\ git commit -m "let there be light" 230 \\ GIT_SSH_COMMAND='ssh -p 8022 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' git push localhost:test HEAD:master 231 \\ 232 \\to quit, press enter. 233 \\ 234 , .{}); 235 // portable stdin read via std.Io — equivalent to the 236 // std.posix.read(STDIN_FILENO, ...) that doesn't compile 237 // on windows. 238 var buf: [1]u8 = undefined; 239 var stdin_reader = std.Io.File.stdin().reader(self.io, &buf); 240 _ = stdin_reader.interface.takeByte() catch {}; 241 } 242 }; 243 244 try srv.run(.xit, .{}, io, allocator, cwd_path, .{ 245 .data_dir = server_path, 246 }, run_opts.err, Runnable{ .io = io }); 247 } else { 248 var null_writer = std.Io.Writer.Discarding.init(&.{}); 249 const run_opts = hx.main.RunOpts{ .out = &null_writer.writer, .err = &null_writer.writer }; 250 251 const Runnable = struct { 252 io: std.Io, 253 allocator: std.mem.Allocator, 254 page: *const ui.Page, 255 session: *ui.Session, 256 257 pub fn run(self: @This()) !void { 258 // launch the TUI 259 try hx.ui.run(self.io, self.allocator, self.page, self.session); 260 } 261 }; 262 263 try srv.run(.xit, .{}, io, allocator, cwd_path, .{ 264 .data_dir = server_path, 265 }, run_opts.err, Runnable{ .io = io, .allocator = allocator, .page = &page, .session = &session }); 266 } 267 } 268