Compare commits

...

2 Commits

Author SHA1 Message Date
bobf
1e3c0468f7
Merge pull request #208 from jetzig-framework/cwd-relative-output-file-args
Use path relative from cwd for output file args
2025-05-25 11:54:18 +01:00
Bob Farrell
0eef2845b3 Use path relative from cwd for output file args
9a3540d61e
2025-05-25 10:58:47 +01:00
3 changed files with 9 additions and 9 deletions

View File

@ -25,16 +25,16 @@
.hash = "jetkv-0.0.0-zCv0fmCGAgCyYqwHjk0P5KrYVRew1MJAtbtAcIO-WPpT",
},
.zmpl = .{
.url = "https://github.com/jetzig-framework/zmpl/archive/1cbe59111f3fe8884f98be83be018459eaf122e0.tar.gz",
.hash = "zmpl-0.0.1-SYFGBiGdAwBTEQE3zb8H1bNVx0AdpL8ACKxyMBmw_sGF",
.url = "https://github.com/jetzig-framework/zmpl/archive/b96cb431742b63302d8afc881660eabaeb1c4554.tar.gz",
.hash = "zmpl-0.0.1-SYFGBrujAwDTRz6rfcxcmmMGT0sL9v2JP85-uG7BdEDb",
},
.httpz = .{
.url = "https://github.com/karlseguin/http.zig/archive/37d7cb9819b804ade5f4b974b82f8dd0622225ed.tar.gz",
.hash = "httpz-0.0.0-PNVzrEK4BgBpHQGA2m0RPqPGEjnTdDXHodBwzjYDrmps",
},
.jetquery = .{
.url = "https://github.com/jetzig-framework/jetquery/archive/8d3dd2ae107767d9c72161a1e4adbb602a16e619.tar.gz",
.hash = "jetquery-0.0.0-TNf3ziK5BgBGDf4BI6tNfTTQ3TpHIGjuonWrlvs8meVg",
.url = "https://github.com/jetzig-framework/jetquery/archive/907acae15dd36834dbdab06b17c3ba8f576d77cb.tar.gz",
.hash = "jetquery-0.0.0-TNf3zm-5BgDOtCpRuVLEZQMWjkgKWRe1pNlGhrdoyvYE",
},
},

View File

@ -10,8 +10,8 @@
.hash = "zig_args-0.0.0-jqtN6P_NAAC97fGpk9hS2K681jkiqPsWP6w3ucb_ctGH",
},
.jetquery = .{
.url = "https://github.com/jetzig-framework/jetquery/archive/8d3dd2ae107767d9c72161a1e4adbb602a16e619.tar.gz",
.hash = "jetquery-0.0.0-TNf3ziK5BgBGDf4BI6tNfTTQ3TpHIGjuonWrlvs8meVg",
.url = "https://github.com/jetzig-framework/jetquery/archive/907acae15dd36834dbdab06b17c3ba8f576d77cb.tar.gz",
.hash = "jetquery-0.0.0-TNf3zm-5BgDOtCpRuVLEZQMWjkgKWRe1pNlGhrdoyvYE",
},
},
.paths = .{

View File

@ -29,7 +29,7 @@ pub fn main() !void {
mailers_path,
);
const generated_routes = try routes.generateRoutes();
var src_dir = try std.fs.openDirAbsolute(src_path, .{ .iterate = true });
var src_dir = try std.fs.cwd().openDir(src_path, .{ .iterate = true });
defer src_dir.close();
var walker = try src_dir.walk(allocator);
defer walker.deinit();
@ -39,7 +39,7 @@ pub fn main() !void {
const stat = try src_dir.statFile(entry.path);
const src_data = try src_dir.readFileAlloc(allocator, entry.path, @intCast(stat.size));
const relpath = try std.fs.path.join(allocator, &[_][]const u8{ "src", entry.path });
var dir = try std.fs.openDirAbsolute(std.fs.path.dirname(output_path).?, .{});
var dir = try std.fs.cwd().openDir(std.fs.path.dirname(output_path).?, .{});
const dest_dir = try dir.makeOpenPath(std.fs.path.dirname(relpath).?, .{});
const src_file = try dest_dir.createFile(std.fs.path.basename(relpath), .{});
try src_file.writeAll(src_data);
@ -47,7 +47,7 @@ pub fn main() !void {
}
}
const file = try std.fs.createFileAbsolute(output_path, .{ .truncate = true });
const file = try std.fs.cwd().createFile(output_path, .{ .truncate = true });
try file.writeAll(generated_routes);
file.close();
}