diff --git a/deps.zig b/deps.zig index 066a054ad91acae4e2561a528467eba3c1c350e4..18eb02fa75abe01bbb99a2a11ed7664df52e36d9 100644 --- a/deps.zig +++ b/deps.zig @@ -60,7 +60,7 @@ pub fn fetch(exe: *std.build.LibExeObjStep) void { exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/iguanaTLS", "c932f557865abaa1d06cd88e9b22a9f3e583fa59").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zfetch", "f51277414a2309f776fb79f3d55f26e37f9a54da").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-ansi", "ac607e4e7ac36d46cc67c8786262578330543a36").step); - exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "8f13721bd18c0e546841b6f2e11da839550d6287").step); + exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-detect-license", "3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-extras", "54abdc5bce0b243601ef4808bce1c29e1a46cdec").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-inquirer", "5cc2a5565d04fe2c0085f0d6818590e800d9dcf7").step); exe.step.dependOn(&GitExactStep.create(b, "https://github.com/nektro/zig-leven", "550cabd5a18ace5e67761bc5b867c10e926f4314").step); @@ -215,9 +215,9 @@ pub const package_data = struct { .deps = &[_]*Package{ &_tnj3qf44tpeq }, }; pub var _2ovav391ivak = Package{ - .store = "/git/github.com/nektro/zig-detect-license/8f13721bd18c0e546841b6f2e11da839550d6287", + .store = "/git/github.com/nektro/zig-detect-license/3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd", .name = "detect-license", - .entry = "/git/github.com/nektro/zig-detect-license/8f13721bd18c0e546841b6f2e11da839550d6287/src/lib.zig", + .entry = "/git/github.com/nektro/zig-detect-license/3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd/src/lib.zig", .deps = &[_]*Package{ &_pt88y5d80m25, &_96h80ezrvj7i }, }; pub var _iecwp4b3bsfm = Package{ diff --git a/src/cmd/init.zig b/src/cmd/init.zig index a472f5f4304bda4a256c321248cc4da106dc55fa..7fb80173b76f1c6ee794cbd83c67cc22fd729fbb 100644 --- a/src/cmd/init.zig +++ b/src/cmd/init.zig @@ -40,7 +40,8 @@ pub fn execute(args: [][]u8) !void { else => |ee| return ee, }) else null; - const license = try inquirer.forString(stdout, stdin, "license:", gpa, try detectlicense.detectInDir(gpa, cwd)); + const maybe_license_text = try detectlicense.detectInDir(gpa, cwd); + const license = try inquirer.forString(stdout, stdin, "license:", gpa, maybe_license_text); const description = try inquirer.forString(stdout, stdin, "description:", gpa, null); @@ -73,7 +74,7 @@ pub fn execute(args: [][]u8) !void { } // ask about LICENSE - if (!(try extras.doesFileExist(null, "LICENSE"))) { + if (maybe_license_text == null) { if (detectlicense.licenses.find(license)) |text| { if (try inquirer.forConfirm(stdout, stdin, "It appears you don't have a LICENSE file defined, would you like init to add it for you?", gpa)) { var realtext = text; diff --git a/zigmod.lock b/zigmod.lock index 51c81438c905bc44fc11adc6b615d90c2b9f31df..bb4a4ccc73cc5b8ac71314ff21dd1af7ad97bc33 100644 --- a/zigmod.lock +++ b/zigmod.lock @@ -4,7 +4,7 @@ git https://github.com/nektro/arqv-ini commit-ddbe89bb0d9085e939bcbc713caeb2b7cf git https://github.com/nektro/iguanaTLS commit-c932f557865abaa1d06cd88e9b22a9f3e583fa59 git https://github.com/nektro/zfetch commit-f51277414a2309f776fb79f3d55f26e37f9a54da git https://github.com/nektro/zig-ansi commit-ac607e4e7ac36d46cc67c8786262578330543a36 -git https://github.com/nektro/zig-detect-license commit-8f13721bd18c0e546841b6f2e11da839550d6287 +git https://github.com/nektro/zig-detect-license commit-3ff57d0681b7bd7f8ca9bd092afa0b4bfe2f1afd git https://github.com/nektro/zig-extras commit-54abdc5bce0b243601ef4808bce1c29e1a46cdec git https://github.com/nektro/zig-inquirer commit-5cc2a5565d04fe2c0085f0d6818590e800d9dcf7 git https://github.com/nektro/zig-leven commit-550cabd5a18ace5e67761bc5b867c10e926f4314