diff --git a/src/cmd/init.zig b/src/cmd/init.zig index c0073b537df0b82f86e303e476e3c27cae683955..b1c23a7ed5af9c0961bfe6374bb139406b79ee75 100644 --- a/src/cmd/init.zig +++ b/src/cmd/init.zig @@ -19,6 +19,7 @@ pub fn execute(args: [][]u8) !void { const stdout = std.io.getStdOut().writer(); const stdin = std.io.getStdIn().reader(); + const cwd = std.fs.cwd(); const id = try inquirer.answer(stdout, "ID (this gets autogenerated):", []const u8, "{s}", try u.random_string(48)); @@ -37,7 +38,7 @@ pub fn execute(args: [][]u8) !void { else => return err, }) else null; - const license = try inquirer.forString(stdout, stdin, "license:", gpa, try detectlicense.detectInDir(gpa, std.fs.cwd())); + const license = try inquirer.forString(stdout, stdin, "license:", gpa, try detectlicense.detectInDir(gpa, cwd)); const description = try inquirer.forString(stdout, stdin, "description:", gpa, null); @@ -56,7 +57,7 @@ pub fn execute(args: [][]u8) !void { std.debug.print("okay. quitting...", .{}); }, true => { - const file = try std.fs.cwd().createFile("zig.mod", .{}); + const file = try cwd.createFile("zig.mod", .{}); defer file.close(); const w = file.writer(); switch (ptype) {