~gpanders/wk

31774479f1c2c45ae420e7bda98f6ab89019fa17 — Greg Anders 8 months ago 8af81fd
Use Dir.makePath instead of std.fs.makeDirAbsolute

`makePath` recursively creates all directories in the hierarchy and
doesn't return an error if the directory already exists.
1 files changed, 1 insertions(+), 5 deletions(-)

M src/main.zig
M src/main.zig => src/main.zig +1 -5
@@ 61,11 61,7 @@ pub fn main() anyerror!void {
    const dir = try zettelDir(allocator);
    defer allocator.free(dir);

    if (std.fs.makeDirAbsolute(dir)) |_| {} else |err| switch (err) {
        error.PathAlreadyExists => {},
        else => return err,
    }

    try std.fs.cwd().makePath(dir);
    try std.process.changeCurDir(dir);

    const command = arglist[1];