authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 15:12:13 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 15:12:13 -07:00
log82f021f019d8dcd7520521bb80e10d7988da27da
tree8d86bfec8eedce5fd003d2538d1d50d398708b2b
parentf242d848aef5798dc8349d22d2bae84aa6a8276d
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

use nio.fmt


8 files changed, 16 insertions(+), 7 deletions(-)

deps.zig+2
...@@ -338,6 +338,7 @@ pub const packages = [_]*Package{...@@ -338,6 +338,7 @@ pub const packages = [_]*Package{
338 &package_data._o6ogpor87xc2,338 &package_data._o6ogpor87xc2,
339 &package_data._f7dubzb7cyqe,339 &package_data._f7dubzb7cyqe,
340 &package_data._s84v9o48ucb0,340 &package_data._s84v9o48ucb0,
341 &package_data._kscsl0145t7x,
341};342};
342343
343pub const pkgs = struct {344pub const pkgs = struct {
...@@ -345,6 +346,7 @@ pub const pkgs = struct {...@@ -345,6 +346,7 @@ pub const pkgs = struct {
345 pub const win32 = &package_data._o6ogpor87xc2;346 pub const win32 = &package_data._o6ogpor87xc2;
346 pub const extras = &package_data._f7dubzb7cyqe;347 pub const extras = &package_data._f7dubzb7cyqe;
347 pub const ansi = &package_data._s84v9o48ucb0;348 pub const ansi = &package_data._s84v9o48ucb0;
349 pub const nio = &package_data._kscsl0145t7x;
348};350};
349351
350pub const imports = struct {352pub const imports = struct {
src/cmd/init.zig+2-1
...@@ -8,6 +8,7 @@ const knownfolders = @import("known-folders");...@@ -8,6 +8,7 @@ const knownfolders = @import("known-folders");
8const ini = @import("ini");8const ini = @import("ini");
9const time = @import("time");9const time = @import("time");
10const extras = @import("extras");10const extras = @import("extras");
11const nio = @import("nio");
1112
12const u = @import("./../util/funcs.zig");13const u = @import("./../util/funcs.zig");
13const common = @import("./../common.zig");14const common = @import("./../common.zig");
...@@ -85,7 +86,7 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {...@@ -85,7 +86,7 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {
85 "year:",86 "year:",
86 string,87 string,
87 "{s}",88 "{s}",
88 try std.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}),89 try nio.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}),
89 ));90 ));
90 realtext = try std.mem.replaceOwned(u8, gpa, realtext, "<copyright holders>", try inquirer.forString(91 realtext = try std.mem.replaceOwned(u8, gpa, realtext, "<copyright holders>", try inquirer.forString(
91 stdout,92 stdout,
src/cmd/install.zig+3-2
...@@ -3,6 +3,7 @@ const string = []const u8;...@@ -3,6 +3,7 @@ const string = []const u8;
3const gpa = std.heap.c_allocator;3const gpa = std.heap.c_allocator;
4const knownfolders = @import("known-folders");4const knownfolders = @import("known-folders");
5const extras = @import("extras");5const extras = @import("extras");
6const nio = @import("nio");
67
7const zigmod = @import("./../lib.zig");8const zigmod = @import("./../lib.zig");
8const u = @import("./../util/funcs.zig");9const u = @import("./../util/funcs.zig");
...@@ -62,8 +63,8 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {...@@ -62,8 +63,8 @@ pub fn execute(self_name: []const u8, args: [][:0]u8) !void {
62 try ci.do(gpa, cachepath, moddir);63 try ci.do(gpa, cachepath, moddir);
6364
64 const modfile = try zigmod.ModFile.from_dir(gpa, moddir, modpath);65 const modfile = try zigmod.ModFile.from_dir(gpa, moddir, modpath);
65 const zigversion_sv = modfile.min_zig_version orelse u.fail("zigmod manifest requires min_zig_version field", .{});66 _ = modfile.min_zig_version orelse u.fail("zigmod manifest requires min_zig_version field", .{});
66 const zigversion = try std.fmt.allocPrint(gpa, "{}", .{zigversion_sv});67 const zigversion = try nio.fmt.allocPrint(gpa, "{s}", .{modfile.yaml.get_string("min_zig_version").?});
67 const zigpath = try std.fs.path.join(gpa, &.{ datapath, "zig", zigversion, "zig" });68 const zigpath = try std.fs.path.join(gpa, &.{ datapath, "zig", zigversion, "zig" });
6869
69 // zig build70 // zig build
src/common.zig+2-1
...@@ -3,6 +3,7 @@ const string = []const u8;...@@ -3,6 +3,7 @@ const string = []const u8;
3const builtin = @import("builtin");3const builtin = @import("builtin");
4const ansi = @import("ansi");4const ansi = @import("ansi");
5const extras = @import("extras");5const extras = @import("extras");
6const nio = @import("nio");
67
7const zigmod = @import("./lib.zig");8const zigmod = @import("./lib.zig");
8const u = @import("./util/funcs.zig");9const u = @import("./util/funcs.zig");
...@@ -302,7 +303,7 @@ pub fn gen_files_package(alloc: std.mem.Allocator, cachepath: string, mdir: std....@@ -302,7 +303,7 @@ pub fn gen_files_package(alloc: std.mem.Allocator, cachepath: string, mdir: std.
302 continue;303 continue;
303 }304 }
304 const path = try alloc.dupe(u8, p.path);305 const path = try alloc.dupe(u8, p.path);
305 try map.put(path, try std.fmt.allocPrint(alloc, "{s}/{s}", .{ dir_path, path }));306 try map.put(path, try nio.fmt.allocPrint(alloc, "{s}/{s}", .{ dir_path, path }));
306 }307 }
307 }308 }
308309
src/main.zig+2-1
...@@ -4,6 +4,7 @@ const builtin = @import("builtin");...@@ -4,6 +4,7 @@ const builtin = @import("builtin");
4pub const build_options = @import("build_options");4pub const build_options = @import("build_options");
5const zigmod = @import("zigmod");5const zigmod = @import("zigmod");
6const win32 = @import("win32");6const win32 = @import("win32");
7const nio = @import("nio");
78
8//9//
9//10//
...@@ -56,7 +57,7 @@ pub fn main() !void {...@@ -56,7 +57,7 @@ pub fn main() !void {
56 }57 }
5758
58 var sub_cmd_args = std.ArrayList(string).init(gpa);59 var sub_cmd_args = std.ArrayList(string).init(gpa);
59 try sub_cmd_args.append(try std.fmt.allocPrint(gpa, "zigmod-{s}", .{args[0]}));60 try sub_cmd_args.append(try nio.fmt.allocPrint(gpa, "zigmod-{s}", .{args[0]}));
60 for (args[1..]) |item| {61 for (args[1..]) |item| {
61 try sub_cmd_args.append(item);62 try sub_cmd_args.append(item);
62 }63 }
src/util/dep_type.zig+2-1
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const nio = @import("nio");
34
4const u = @import("./funcs.zig");5const u = @import("./funcs.zig");
56
...@@ -68,7 +69,7 @@ pub const DepType = enum {...@@ -68,7 +69,7 @@ pub const DepType = enum {
68 .local => "",69 .local => "",
69 .system_lib => "",70 .system_lib => "",
70 .framework => "",71 .framework => "",
71 .git => try std.fmt.allocPrint(alloc, "commit-{s}", .{(try u.git_rev_HEAD(alloc, mdir))}),72 .git => try nio.fmt.allocPrint(alloc, "commit-{s}", .{(try u.git_rev_HEAD(alloc, mdir))}),
72 .hg => "",73 .hg => "",
73 .http => "",74 .http => "",
74 };75 };
src/util/module.zig+2-1
...@@ -3,6 +3,7 @@ const string = []const u8;...@@ -3,6 +3,7 @@ const string = []const u8;
3const builtin = @import("builtin");3const builtin = @import("builtin");
4const yaml = @import("yaml");4const yaml = @import("yaml");
5const extras = @import("extras");5const extras = @import("extras");
6const nio = @import("nio");
67
7const zigmod = @import("../lib.zig");8const zigmod = @import("../lib.zig");
8const u = @import("funcs.zig");9const u = @import("funcs.zig");
...@@ -95,7 +96,7 @@ pub const Module = struct {...@@ -95,7 +96,7 @@ pub const Module = struct {
95 }96 }
96 var out: [32]u8 = undefined;97 var out: [32]u8 = undefined;
97 h.final(&out);98 h.final(&out);
98 const hex = try std.fmt.allocPrint(alloc, "blake3-{x}", .{std.fmt.fmtSliceHexLower(out[0..])});99 const hex = try nio.fmt.allocPrint(alloc, "blake3-{s}", .{&extras.to_hex(out)});
99 return hex;100 return hex;
100 }101 }
101102
zig.mod+1
...@@ -35,3 +35,4 @@ root_dependencies:...@@ -35,3 +35,4 @@ root_dependencies:
35 license: MIT35 license: MIT
36 - src: git https://github.com/nektro/zig-extras36 - src: git https://github.com/nektro/zig-extras
37 - src: git https://github.com/nektro/zig-ansi37 - src: git https://github.com/nektro/zig-ansi
38 - src: git https://github.com/nektro/zig-nio