mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-09-28 15:35:43 -04:00
lp.update -> lp.checkVersion + honor --check in version
This commit is contained in:
2 files changed
+8
-6
No files matched your search
+1
-3
@@ -225,8 +225,7 @@ fn dumpContent(app: *App, mode: Config.DumpFormat, dump_opts: dump.Opts, frame:
|
||||
}
|
||||
}
|
||||
|
||||
/// Check `Config.zig` for `options`.
|
||||
pub fn update(allocator: std.mem.Allocator, config: *const Config) !void {
|
||||
pub fn checkVersion(allocator: std.mem.Allocator, config: *const Config) !void {
|
||||
var client = try Updater.init(allocator, config);
|
||||
defer client.deinit();
|
||||
|
||||
@@ -234,7 +233,6 @@ pub fn update(allocator: std.mem.Allocator, config: *const Config) !void {
|
||||
var buf: [4096]u8 = undefined;
|
||||
var writer = stdout.writer(&buf);
|
||||
const w = &writer.interface;
|
||||
// Inform to stdout about version.
|
||||
try client.inform(w);
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -71,9 +71,13 @@ fn run(allocator: Allocator, main_arena: Allocator) !void {
|
||||
|
||||
switch (args.mode) {
|
||||
.help => |tag| return args.printUsageAndExit(tag, true),
|
||||
.version => {
|
||||
var stdout = std.fs.File.stdout().writer(&.{});
|
||||
try stdout.interface.print("{s}\n", .{lp.build_config.version});
|
||||
.version => |opts| {
|
||||
if (opts.check) {
|
||||
try lp.checkVersion(allocator, &args);
|
||||
} else {
|
||||
var stdout = std.fs.File.stdout().writer(&.{});
|
||||
try stdout.interface.print("{s}\n", .{lp.build_config.version});
|
||||
}
|
||||
return std.process.cleanExit();
|
||||
},
|
||||
.agent => |opts| if (opts.list_models) {
|
||||
|
||||
Reference in new issue
Block a user