From d74a49456d91cc5c15789e20301603fccbc12f11 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Thu, 21 Jul 2022 14:17:25 +0200 Subject: [PATCH] autodoc: use already open handles to output docs artifacts --- src/Autodoc.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Autodoc.zig b/src/Autodoc.zig index a2767aa9ee..b06b517615 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -266,12 +266,12 @@ pub fn generateZirData(self: *Autodoc) !void { // last thing (that can fail) that we do is flush buffer.flush() catch unreachable; } + // copy main.js, index.html - const docs = try self.module.comp.zig_lib_directory.join(self.arena, &.{ "docs", std.fs.path.sep_str }); - var docs_dir = std.fs.openDirAbsolute(docs, .{}) catch unreachable; + var docs_dir = try self.module.comp.zig_lib_directory.handle.openDir("docs", .{}); defer docs_dir.close(); - docs_dir.copyFile("main.js", output_dir, "main.js", .{}) catch unreachable; - docs_dir.copyFile("index.html", output_dir, "index.html", .{}) catch unreachable; + try docs_dir.copyFile("main.js", output_dir, "main.js", .{}); + try docs_dir.copyFile("index.html", output_dir, "index.html", .{}); } /// Represents a chain of scopes, used to resolve decl references to the