update: remove nightly channel check

This commit is contained in:
Halil Durak
2026-06-29 13:57:50 +03:00
parent 4c62337cfa
commit 32fefeaa7a
3 changed files with 5 additions and 23 deletions

View File

@@ -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 = .{} },
});

View File

@@ -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

View File

@@ -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 => {},