Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637const std = @import("std");const mem = std.mem;const heap = std.heap;const json = std.json;const Io = std.Io;
// Keeping it just to not break config files in futureconst Method = enum { bind,};
const Mount = struct { target: []const u8, directories: []const Directory = &.{}, files: []const File = &.{},};
const File = struct { path: [:0]const u8, method: Method = .bind,};
const Directory = struct { path: [:0]const u8, method: Method = .bind,};
mounts: []const Mount,
const Self = @This();
pub fn load(io: Io, alloc: mem.Allocator, path: []const u8) !struct { Self, *heap.ArenaAllocator } { const source = try Io.Dir.cwd().readFileAlloc(io, path, alloc, .unlimited); const parsed = try json.parseFromSlice(Self, alloc, source, .{}); return .{ parsed.value, parsed.arena };}