mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-07-01 13:36:08 +00:00
Merge pull request #208 from jetzig-framework/cwd-relative-output-file-args
Use path relative from cwd for output file args
This commit is contained in:
commit
1e3c0468f7
@ -25,16 +25,16 @@
|
|||||||
.hash = "jetkv-0.0.0-zCv0fmCGAgCyYqwHjk0P5KrYVRew1MJAtbtAcIO-WPpT",
|
.hash = "jetkv-0.0.0-zCv0fmCGAgCyYqwHjk0P5KrYVRew1MJAtbtAcIO-WPpT",
|
||||||
},
|
},
|
||||||
.zmpl = .{
|
.zmpl = .{
|
||||||
.url = "https://github.com/jetzig-framework/zmpl/archive/1cbe59111f3fe8884f98be83be018459eaf122e0.tar.gz",
|
.url = "https://github.com/jetzig-framework/zmpl/archive/b96cb431742b63302d8afc881660eabaeb1c4554.tar.gz",
|
||||||
.hash = "zmpl-0.0.1-SYFGBiGdAwBTEQE3zb8H1bNVx0AdpL8ACKxyMBmw_sGF",
|
.hash = "zmpl-0.0.1-SYFGBrujAwDTRz6rfcxcmmMGT0sL9v2JP85-uG7BdEDb",
|
||||||
},
|
},
|
||||||
.httpz = .{
|
.httpz = .{
|
||||||
.url = "https://github.com/karlseguin/http.zig/archive/37d7cb9819b804ade5f4b974b82f8dd0622225ed.tar.gz",
|
.url = "https://github.com/karlseguin/http.zig/archive/37d7cb9819b804ade5f4b974b82f8dd0622225ed.tar.gz",
|
||||||
.hash = "httpz-0.0.0-PNVzrEK4BgBpHQGA2m0RPqPGEjnTdDXHodBwzjYDrmps",
|
.hash = "httpz-0.0.0-PNVzrEK4BgBpHQGA2m0RPqPGEjnTdDXHodBwzjYDrmps",
|
||||||
},
|
},
|
||||||
.jetquery = .{
|
.jetquery = .{
|
||||||
.url = "https://github.com/jetzig-framework/jetquery/archive/8d3dd2ae107767d9c72161a1e4adbb602a16e619.tar.gz",
|
.url = "https://github.com/jetzig-framework/jetquery/archive/907acae15dd36834dbdab06b17c3ba8f576d77cb.tar.gz",
|
||||||
.hash = "jetquery-0.0.0-TNf3ziK5BgBGDf4BI6tNfTTQ3TpHIGjuonWrlvs8meVg",
|
.hash = "jetquery-0.0.0-TNf3zm-5BgDOtCpRuVLEZQMWjkgKWRe1pNlGhrdoyvYE",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
.hash = "zig_args-0.0.0-jqtN6P_NAAC97fGpk9hS2K681jkiqPsWP6w3ucb_ctGH",
|
.hash = "zig_args-0.0.0-jqtN6P_NAAC97fGpk9hS2K681jkiqPsWP6w3ucb_ctGH",
|
||||||
},
|
},
|
||||||
.jetquery = .{
|
.jetquery = .{
|
||||||
.url = "https://github.com/jetzig-framework/jetquery/archive/8d3dd2ae107767d9c72161a1e4adbb602a16e619.tar.gz",
|
.url = "https://github.com/jetzig-framework/jetquery/archive/907acae15dd36834dbdab06b17c3ba8f576d77cb.tar.gz",
|
||||||
.hash = "jetquery-0.0.0-TNf3ziK5BgBGDf4BI6tNfTTQ3TpHIGjuonWrlvs8meVg",
|
.hash = "jetquery-0.0.0-TNf3zm-5BgDOtCpRuVLEZQMWjkgKWRe1pNlGhrdoyvYE",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
|
@ -29,7 +29,7 @@ pub fn main() !void {
|
|||||||
mailers_path,
|
mailers_path,
|
||||||
);
|
);
|
||||||
const generated_routes = try routes.generateRoutes();
|
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();
|
defer src_dir.close();
|
||||||
var walker = try src_dir.walk(allocator);
|
var walker = try src_dir.walk(allocator);
|
||||||
defer walker.deinit();
|
defer walker.deinit();
|
||||||
@ -39,7 +39,7 @@ pub fn main() !void {
|
|||||||
const stat = try src_dir.statFile(entry.path);
|
const stat = try src_dir.statFile(entry.path);
|
||||||
const src_data = try src_dir.readFileAlloc(allocator, entry.path, @intCast(stat.size));
|
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 });
|
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 dest_dir = try dir.makeOpenPath(std.fs.path.dirname(relpath).?, .{});
|
||||||
const src_file = try dest_dir.createFile(std.fs.path.basename(relpath), .{});
|
const src_file = try dest_dir.createFile(std.fs.path.basename(relpath), .{});
|
||||||
try src_file.writeAll(src_data);
|
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);
|
try file.writeAll(generated_routes);
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user