From 32fefeaa7a61bdd6bba4b24f240a09be02a142fd Mon Sep 17 00:00:00 2001 From: Halil Durak Date: Mon, 29 Jun 2026 13:57:50 +0300 Subject: [PATCH] `update`: remove nightly channel check --- src/Config.zig | 20 +------------------- src/lightpanda.zig | 4 ++-- src/main.zig | 4 ++-- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index 992201a8e..9c2051ebf 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -18,7 +18,6 @@ const std = @import("std"); const lp = @import("lightpanda"); -const Updater = lp.Updater; const log = lp.log; const builtin = @import("builtin"); const zenai = @import("zenai"); @@ -189,10 +188,6 @@ fn injectScriptFileValidator( return list.append(allocator, bytes); } -fn nightlyChannelValidator(_: Allocator, _: *std.process.ArgIterator) !Updater.Channel { - return .nightly; -} - /// Definition for all the commands and its arguments. See @cli.zig for further. const Commands = cli.Builder(.{ .{ @@ -267,20 +262,7 @@ const Commands = cli.Builder(.{ }, .shared_options = CommonOptions, }, - .{ - .name = "update", - .options = .{ - .{ - .name = "channel", - .type = Updater.Channel, - .default = .stable, - .variants = .{ - .{ .name = "nightly", .validator = nightlyChannelValidator }, - }, - }, - }, - .shared_options = CommonOptions, - }, + .{ .name = "update", .options = .{}, .shared_options = CommonOptions }, .{ .name = "version", .options = .{} }, }); diff --git a/src/lightpanda.zig b/src/lightpanda.zig index a6e3951bf..f7ec92c8b 100644 --- a/src/lightpanda.zig +++ b/src/lightpanda.zig @@ -226,7 +226,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, options: anytype) !void { +pub fn update(allocator: std.mem.Allocator, config: *const Config) !void { var client = try Updater.init(allocator, config); defer client.deinit(); @@ -235,7 +235,7 @@ pub fn update(allocator: std.mem.Allocator, config: *const Config, options: anyt var writer = stdout.writer(&buf); const w = &writer.interface; // Inform to stdout about version. - try client.inform(options.channel, w); + try client.inform(w); } // Writes a single page's result object. Framing (the enclosing array and any diff --git a/src/main.zig b/src/main.zig index a733b0ba6..8d8442f0b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -80,8 +80,8 @@ fn run(allocator: Allocator, main_arena: Allocator) !void { try lp.Agent.listModels(allocator, opts); return std.process.cleanExit(); }, - .update => |options| { - try lp.update(allocator, &args, options); + .update => { + try lp.update(allocator, &args); return std.process.cleanExit(); }, else => {},