Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove async integration #44

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions known-folders.zig
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,7 @@ fn getPathXdg(allocator: std.mem.Allocator, arena: *std.heap.ArenaAllocator, fol
if (!folder_spec.env.user_dir) break :env_opt null;

// TODO: add caching so we only need to read once in a run
const config_dir_path = if (std.io.is_async) blk: {
var frame = arena.allocator().create(@Frame(getPathXdg)) catch break :env_opt null;
_ = @asyncCall(frame, {}, getPathXdg, .{ arena.allocator(), arena, .local_configuration });
break :blk (await frame) catch null orelse break :env_opt null;
} else blk: {
break :blk getPathXdg(arena.allocator(), arena, .local_configuration) catch null orelse break :env_opt null;
};

const config_dir_path = getPathXdg(arena.allocator(), arena, .local_configuration) catch null orelse break :env_opt null;
const config_dir = std.fs.cwd().openDir(config_dir_path, .{}) catch break :env_opt null;
const home = std.process.getEnvVarOwned(arena.allocator(), "HOME") catch null orelse break :env_opt null;
const user_dirs = config_dir.openFile("user-dirs.dirs", .{}) catch null orelse break :env_opt null;
Expand Down
Loading