fixed fatal error on fresh install, and changed build file to link straight to lua5.4
Browse files
+2 −2 build.zig
| @@ -13,7 +13,7 @@ pub fn build(b: *std.Build) void { | ||
| 13 | 13 | }), |
| 14 | 14 | }); |
| 15 | 15 | |
| 16 | - exe.linkSystemLibrary("lua"); | |
| 16 | + exe.linkSystemLibrary("lua5.4"); | |
| 17 | 17 | exe.linkSystemLibrary("X11"); |
| 18 | 18 | exe.linkSystemLibrary("Xinerama"); |
| 19 | 19 | exe.linkSystemLibrary("Xft"); |
| @@ -52,7 +52,7 @@ pub fn build(b: *std.Build) void { | ||
| 52 | 52 | .target = target, |
| 53 | 53 | .optimize = optimize, |
| 54 | 54 | })); |
| 55 | - lua_config_tests.linkSystemLibrary("lua"); | |
| 55 | + lua_config_tests.linkSystemLibrary("lua5.4"); | |
| 56 | 56 | lua_config_tests.linkLibC(); |
| 57 | 57 | test_step.dependOn(&b.addRunArtifact(lua_config_tests).step); |
| 58 | 58 |
+3 −5 src/main.zig
| @@ -113,11 +113,9 @@ fn init_config(allocator: std.mem.Allocator) void { | ||
| 113 | 113 | return; |
| 114 | 114 | }; |
| 115 | 115 | |
| 116 | - std.fs.makeDirAbsolute(config_dir) catch |err| { | |
| 117 | - if (err != error.PathAlreadyExists) { | |
| 118 | - std.debug.print("error: could not create config directory: {}\n", .{err}); | |
| 119 | - return; | |
| 120 | - } | |
| 116 | + std.fs.cwd().makePath(config_dir) catch |err| { | |
| 117 | + std.debug.print("error: could not create config directory: {}\n", .{err}); | |
| 118 | + return; | |
| 121 | 119 | }; |
| 122 | 120 | |
| 123 | 121 | var config_path_buf: [512]u8 = undefined; |