authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-19 01:32:59 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-19 01:32:59 -08:00
log4c4536d2f8ba108d3fe9a2555c9e2e633567b621
treec7b580737f295fef50263f8e4e09845d57181f67
parenta8cd50a5a6530aec048484d87d0f7f7c3f4bb978

cmd/init- use zig-time to properly fill in license year


4 files changed, 11 insertions(+), 4 deletions(-)

deps.zig+6-1
......@@ -69,6 +69,7 @@ pub const dirs = struct {
6969 pub const _qyrnfg0iwpzl = cache ++ "/git/github.com/nektro/zig-fs-check";
7070 pub const _c1xirp1ota5p = cache ++ "/git/github.com/nektro/zig-inquirer";
7171 pub const _u7sysdckdymi = cache ++ "/git/github.com/arqv/ini";
72 pub const _iecwp4b3bsfm = cache ++ "/git/github.com/nektro/zig-time";
7273 pub const _o6ogpor87xc2 = cache ++ "/git/github.com/marlersoft/zigwin32";
7374};
7475
......@@ -147,9 +148,13 @@ pub const package_data = struct {
147148 .directory = dirs._u7sysdckdymi,
148149 .pkg = Pkg{ .name = "ini", .path = .{ .path = dirs._u7sysdckdymi ++ "/src/ini.zig" }, .dependencies = null },
149150 };
151 pub const _iecwp4b3bsfm = Package{
152 .directory = dirs._iecwp4b3bsfm,
153 .pkg = Pkg{ .name = "time", .path = .{ .path = dirs._iecwp4b3bsfm ++ "/time.zig" }, .dependencies = &.{ _tnj3qf44tpeq.pkg.? } },
154 };
150155 pub const _89ujp8gq842x = Package{
151156 .directory = dirs._89ujp8gq842x,
152 .pkg = Pkg{ .name = "zigmod", .path = .{ .path = dirs._89ujp8gq842x ++ "/src/lib.zig" }, .dependencies = &.{ _csbnipaad8n7.pkg.?, _s84v9o48ucb0.pkg.?, _2ta738wrqbaq.pkg.?, _0npcrzfdlrvk.pkg.?, _ejw82j2ipa0e.pkg.?, _ocmr9rtohgcc.pkg.?, _tnj3qf44tpeq.pkg.?, _2ovav391ivak.pkg.?, _c1xirp1ota5p.pkg.?, _u7sysdckdymi.pkg.? } },
157 .pkg = Pkg{ .name = "zigmod", .path = .{ .path = dirs._89ujp8gq842x ++ "/src/lib.zig" }, .dependencies = &.{ _csbnipaad8n7.pkg.?, _s84v9o48ucb0.pkg.?, _2ta738wrqbaq.pkg.?, _0npcrzfdlrvk.pkg.?, _ejw82j2ipa0e.pkg.?, _ocmr9rtohgcc.pkg.?, _tnj3qf44tpeq.pkg.?, _2ovav391ivak.pkg.?, _c1xirp1ota5p.pkg.?, _u7sysdckdymi.pkg.?, _f7dubzb7cyqe.pkg.?, _iecwp4b3bsfm.pkg.? } },
153158 };
154159 pub const _o6ogpor87xc2 = Package{
155160 .directory = dirs._o6ogpor87xc2,
src/cmd/init.zig+3-3
......@@ -6,13 +6,13 @@ const inquirer = @import("inquirer");
66const detectlicense = @import("detect-license");
77const knownfolders = @import("known-folders");
88const ini = @import("ini");
9const time = @import("time");
10
911const u = @import("./../util/index.zig");
1012
1113//
1214//
1315
14const s_in_y = std.time.s_per_week * 52;
15
1616pub fn execute(args: [][]u8) !void {
1717 _ = args;
1818
......@@ -84,7 +84,7 @@ pub fn execute(args: [][]u8) !void {
8484 "year:",
8585 string,
8686 "{s}",
87 try std.fmt.allocPrint(gpa, "{d}", .{1970 + @divFloor(std.time.timestamp(), s_in_y)}),
87 try std.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}),
8888 ));
8989 realtext = try std.mem.replaceOwned(u8, gpa, realtext, "<copyright holders>", try inquirer.forString(
9090 stdout,
zig.mod+1
......@@ -41,6 +41,7 @@ dependencies:
4141 - src: git https://github.com/nektro/zig-detect-license
4242 - src: git https://github.com/nektro/zig-inquirer
4343 - src: git https://github.com/arqv/ini
44 - src: git https://github.com/nektro/zig-time
4445
4546root_dependencies:
4647 - src: git https://github.com/marlersoft/zigwin32
zigmod.lock+1
......@@ -17,4 +17,5 @@ git https://github.com/nektro/zig-leven commit-ab852cf74fa0b4edc530d925f0654b62c
1717git https://github.com/nektro/zig-fs-check commit-dcd8da90fcb8bf3c9887e713bf0ec072bc897dd5
1818git https://github.com/nektro/zig-inquirer commit-14c3492c46f9765c3e77436741794d1a3118cbee
1919git https://github.com/arqv/ini commit-b93f5b5ff9449f9af68ae3081f6a5e858b6698d9
20git https://github.com/nektro/zig-time commit-d36cf720d305ffcf3003d855feeb00a10913bc56
2021git https://github.com/marlersoft/zigwin32 commit-a74c9dae6a1ccd361eb9a1d146a09c08d22f02b0