authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-02 21:52:02 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-05-02 21:52:02 -07:00
log2a1a595dec91552d05b2f0c6c666f14dbb301e70
tree14ceb194133c989917b190333834bc14a83614aa
parenta9298362417cf023f783440343374ed212ada707

add aq.server_root decl

will make this a dynamic list of instances in the future

2 files changed, 5 insertions(+), 2 deletions(-)

src/cmd/aq.zig+2
......@@ -10,6 +10,8 @@ pub const commands = struct {
1010 pub const add = @import("./aquila/add.zig");
1111};
1212
13pub const server_root = "https://aquila.red";
14
1315pub fn execute(args: [][]u8) !void {
1416 if (args.len == 0) {
1517 std.debug.warn("{s}\n", .{
src/cmd/aquila/add.zig+3-2
......@@ -5,6 +5,7 @@ const zfetch = @import("zfetch");
55const json = @import("json");
66
77const u = @import("./../../util/index.zig");
8const aq = @import("./../aq.zig");
89
910//
1011//
......@@ -12,7 +13,7 @@ const u = @import("./../../util/index.zig");
1213pub fn execute(args: [][]u8) !void {
1314 const pkg_id = args[0];
1415
15 const url = try std.mem.join(gpa, "/", &.{ "https://aquila.red", pkg_id });
16 const url = try std.mem.join(gpa, "/", &.{ aq.server_root, pkg_id });
1617
1718 const req = try zfetch.Request.init(gpa, url, null);
1819 defer req.deinit();
......@@ -58,7 +59,7 @@ pub fn execute(args: [][]u8) !void {
5859
5960 const file_w = file.writer();
6061 try file_w.print("\n", .{});
61 try file_w.print(" - src: http https://aquila.red/{s}/v{d}.{d}.tar.gz _ {d} {d}\n", .{ pkg_id, v_maj, v_min, v_maj, v_min });
62 try file_w.print(" - src: http {s}/{s}/v{d}.{d}.tar.gz _ {d} {d}\n", .{ aq.server_root, pkg_id, v_maj, v_min, v_maj, v_min });
6263 try file_w.print(" version: {s}\n", .{v_hash});
6364
6465 std.log.info("Successfully added package {s}", .{pkg_id});