╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ try.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
247 \\ cd temp-try/client/test 248 \\ git init 249 \\ echo "hello" > hello.txt 250 \\ git add hello.txt 251 \\ git commit -m "let there be light" 252 \\ GIT_SSH_COMMAND='ssh -p 8022 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' git push localhost:test HEAD:master 253 \\ 254 \\to quit, press enter. 255 \\ 256 , .{}); 257 // portable stdin read via std.Io — equivalent to the 258 // std.posix.read(STDIN_FILENO, ...) that doesn't compile 259 // on windows. 260 var buf: [1]u8 = undefined; 261 var stdin_reader = std.Io.File.stdin().reader(self.io, &buf); 262 _ = stdin_reader.interface.takeByte() catch {}; 263 } 264 }; 265 266 try srv.run(.xit, .{}, io, allocator, cwd_path, .{ 267 .data_dir = server_path, 268 }, run_opts.err, Runnable{ .io = io }); 269 } else { 270 var null_writer = std.Io.Writer.Discarding.init(&.{}); 271 const run_opts = hx.main.RunOpts{ .out = &null_writer.writer, .err = &null_writer.writer }; 272 273 const Runnable = struct { 274 io: std.Io, 275 allocator: std.mem.Allocator, 276 session: *ui.Session, 277 278 pub fn run(self: @This()) !void { 279 // launch the TUI 280 try hx.ui.run(self.io, self.allocator, self.session); 281 } 282 }; 283 284 try srv.run(.xit, .{}, io, allocator, cwd_path, .{ 285 .data_dir = server_path, 286 }, run_opts.err, Runnable{ .io = io, .allocator = allocator, .session = &session }); 287 } 288 } 289