mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-08 04:57:32 -04:00
add a basic filesystem library and use it for path concat
This commit is contained in:
parent
9e55195f8d
commit
8e4f56d147
3 changed files with 52 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ const config = @import("config");
|
|||
const zlua = @import("zlua");
|
||||
|
||||
const Bridge = @import("bridge.zig");
|
||||
const Fs = @import("fs.zig");
|
||||
|
||||
const gpa = std.heap.c_allocator;
|
||||
|
||||
|
|
@ -51,6 +52,11 @@ pub fn init(self: *Lua) !void {
|
|||
self.state.newTable();
|
||||
defer _ = self.state.setField(-2, "path");
|
||||
}
|
||||
{
|
||||
const funcs = zlua.fnRegsFromType(Fs);
|
||||
self.state.newLib(funcs);
|
||||
self.state.setField(-2, "fs");
|
||||
}
|
||||
}
|
||||
|
||||
loadRuntimeDir(self) catch |err| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue