| ... | @@ -19,6 +19,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -19,6 +19,7 @@ pub fn execute(args: [][]u8) !void { |
| 19 | | 19 | |
| 20 | const stdout = std.io.getStdOut().writer(); | 20 | const stdout = std.io.getStdOut().writer(); |
| 21 | const stdin = std.io.getStdIn().reader(); | 21 | const stdin = std.io.getStdIn().reader(); |
| | 22 | const cwd = std.fs.cwd(); |
| 22 | | 23 | |
| 23 | const id = try inquirer.answer(stdout, "ID (this gets autogenerated):", []const u8, "{s}", try u.random_string(48)); | 24 | const id = try inquirer.answer(stdout, "ID (this gets autogenerated):", []const u8, "{s}", try u.random_string(48)); |
| 24 | | 25 | |
| ... | @@ -37,7 +38,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -37,7 +38,7 @@ pub fn execute(args: [][]u8) !void { |
| 37 | else => return err, | 38 | else => return err, |
| 38 | }) else null; | 39 | }) else null; |
| 39 | | 40 | |
| 40 | const license = try inquirer.forString(stdout, stdin, "license:", gpa, try detectlicense.detectInDir(gpa, std.fs.cwd())); | 41 | const license = try inquirer.forString(stdout, stdin, "license:", gpa, try detectlicense.detectInDir(gpa, cwd)); |
| 41 | | 42 | |
| 42 | const description = try inquirer.forString(stdout, stdin, "description:", gpa, null); | 43 | const description = try inquirer.forString(stdout, stdin, "description:", gpa, null); |
| 43 | | 44 | |
| ... | @@ -56,7 +57,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -56,7 +57,7 @@ pub fn execute(args: [][]u8) !void { |
| 56 | std.debug.print("okay. quitting...", .{}); | 57 | std.debug.print("okay. quitting...", .{}); |
| 57 | }, | 58 | }, |
| 58 | true => { | 59 | true => { |
| 59 | const file = try std.fs.cwd().createFile("zig.mod", .{}); | 60 | const file = try cwd.createFile("zig.mod", .{}); |
| 60 | defer file.close(); | 61 | defer file.close(); |
| 61 | const w = file.writer(); | 62 | const w = file.writer(); |
| 62 | switch (ptype) { | 63 | switch (ptype) { |