implement sentry transport to write crash reports to XDG_STATE_HOME

This commit is contained in:
Mitchell Hashimoto
2024-08-27 19:29:34 -07:00
parent e029490535
commit 2abdf291f4
5 changed files with 58 additions and 3 deletions

View File

@@ -37,6 +37,15 @@ pub fn cache(alloc: Allocator, opts: Options) ![]u8 {
});
}
/// Get the XDG state directory. The returned value is allocated.
pub fn state(alloc: Allocator, opts: Options) ![]u8 {
return try dir(alloc, opts, .{
.env = "XDG_STATE_HOME",
.windows_env = "LOCALAPPDATA",
.default_subdir = ".local/state",
});
}
const InternalOptions = struct {
env: []const u8,
windows_env: []const u8,