Added build_runner_path configuration option
This commit is contained in:
@@ -9,3 +9,7 @@ zig_lib_path: ?[]const u8 = null,
|
||||
/// Whether to pay attention to style issues. This is opt-in since the style
|
||||
/// guide explicitly states that the style info provided is a guideline only.
|
||||
warn_style: bool = false,
|
||||
|
||||
/// Path to the build_runner.zig file. This option must be present in one of
|
||||
/// the global configuration directories to have any effect.
|
||||
build_runner_path: ?[]const u8 = null,
|
||||
|
||||
@@ -924,12 +924,14 @@ pub fn main() anyerror!void {
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (config.build_runner_path) |build_runner_path| {
|
||||
try document_store.init(allocator, has_zig, try std.mem.dupe(allocator, u8, build_runner_path));
|
||||
} else {
|
||||
var exe_dir_bytes: [std.fs.MAX_PATH_BYTES]u8 = undefined;
|
||||
const exe_dir_path = try std.fs.selfExeDirPath(&exe_dir_bytes);
|
||||
|
||||
const document_runner_path = try std.fs.path.resolve(allocator, &[_][]const u8{ exe_dir_path, "build_runner.zig" });
|
||||
try document_store.init(allocator, has_zig, document_runner_path);
|
||||
const build_runner_path = try std.fs.path.resolve(allocator, &[_][]const u8{ exe_dir_path, "build_runner.zig" });
|
||||
try document_store.init(allocator, has_zig, build_runner_path);
|
||||
}
|
||||
|
||||
defer document_store.deinit();
|
||||
|
||||
Reference in New Issue
Block a user