diff --git a/deps.zig b/deps.zig index 03f3d736120a1dacbd45388a20cac93acbbbb6d8..06f813b9ad2743e9d0b1fd79cb1fd94b315efb92 100644 --- a/deps.zig +++ b/deps.zig @@ -69,6 +69,7 @@ pub const dirs = struct { pub const _qyrnfg0iwpzl = cache ++ "/git/github.com/nektro/zig-fs-check"; pub const _c1xirp1ota5p = cache ++ "/git/github.com/nektro/zig-inquirer"; pub const _u7sysdckdymi = cache ++ "/git/github.com/arqv/ini"; + pub const _iecwp4b3bsfm = cache ++ "/git/github.com/nektro/zig-time"; pub const _o6ogpor87xc2 = cache ++ "/git/github.com/marlersoft/zigwin32"; }; @@ -147,9 +148,13 @@ pub const package_data = struct { .directory = dirs._u7sysdckdymi, .pkg = Pkg{ .name = "ini", .path = .{ .path = dirs._u7sysdckdymi ++ "/src/ini.zig" }, .dependencies = null }, }; + pub const _iecwp4b3bsfm = Package{ + .directory = dirs._iecwp4b3bsfm, + .pkg = Pkg{ .name = "time", .path = .{ .path = dirs._iecwp4b3bsfm ++ "/time.zig" }, .dependencies = &.{ _tnj3qf44tpeq.pkg.? } }, + }; pub const _89ujp8gq842x = Package{ .directory = dirs._89ujp8gq842x, - .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.? } }, + .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.? } }, }; pub const _o6ogpor87xc2 = Package{ .directory = dirs._o6ogpor87xc2, diff --git a/src/cmd/init.zig b/src/cmd/init.zig index dbb8871aeeb46157a7dfcf3d61a094995afeacb5..2443bbfb77dd4033e03cecd5aa002984d0a64787 100644 --- a/src/cmd/init.zig +++ b/src/cmd/init.zig @@ -6,13 +6,13 @@ const inquirer = @import("inquirer"); const detectlicense = @import("detect-license"); const knownfolders = @import("known-folders"); const ini = @import("ini"); +const time = @import("time"); + const u = @import("./../util/index.zig"); // // -const s_in_y = std.time.s_per_week * 52; - pub fn execute(args: [][]u8) !void { _ = args; @@ -84,7 +84,7 @@ pub fn execute(args: [][]u8) !void { "year:", string, "{s}", - try std.fmt.allocPrint(gpa, "{d}", .{1970 + @divFloor(std.time.timestamp(), s_in_y)}), + try std.fmt.allocPrint(gpa, "{d}", .{time.DateTime.now().years}), )); realtext = try std.mem.replaceOwned(u8, gpa, realtext, "", try inquirer.forString( stdout, diff --git a/zig.mod b/zig.mod index e68ca71fea414288613ffe5e2774b940cf387702..8d992dcc27d978017756dcdedc86853704b47fd8 100644 --- a/zig.mod +++ b/zig.mod @@ -41,6 +41,7 @@ dependencies: - src: git https://github.com/nektro/zig-detect-license - src: git https://github.com/nektro/zig-inquirer - src: git https://github.com/arqv/ini + - src: git https://github.com/nektro/zig-time root_dependencies: - src: git https://github.com/marlersoft/zigwin32 diff --git a/zigmod.lock b/zigmod.lock index 4a8475f2adeeab91cb7922b348ab2a5fd818d95b..8d96feae15fc852739c5739b3a5f1db6847cb804 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -17,4 +17,5 @@ git https://github.com/nektro/zig-leven commit-ab852cf74fa0b4edc530d925f0654b62c git https://github.com/nektro/zig-fs-check commit-dcd8da90fcb8bf3c9887e713bf0ec072bc897dd5 git https://github.com/nektro/zig-inquirer commit-14c3492c46f9765c3e77436741794d1a3118cbee git https://github.com/arqv/ini commit-b93f5b5ff9449f9af68ae3081f6a5e858b6698d9 +git https://github.com/nektro/zig-time commit-d36cf720d305ffcf3003d855feeb00a10913bc56 git https://github.com/marlersoft/zigwin32 commit-a74c9dae6a1ccd361eb9a1d146a09c08d22f02b0