fix: move flow state files from ~/.cache/flow to ~/.local/state/flow

This better matches the XDG Base Directory Specification.

Please move existing state files from ~/.cache/flow to ~/.local/state/flow
manually if you want to keep them.
This commit is contained in:
CJ van den Berg 2024-06-23 15:49:40 +02:00
parent 42330ba82c
commit e1a94bf8f2
3 changed files with 55 additions and 7 deletions

View file

@ -131,8 +131,8 @@ const Process = struct {
var log_file_path = std.ArrayList(u8).init(self.a);
defer log_file_path.deinit();
const cache_dir = root.get_cache_dir() catch |e| return tp.exit_error(e);
log_file_path.writer().print("{s}/lsp-{s}.log", .{ cache_dir, self.tag }) catch |e| return tp.exit_error(e);
const state_dir = root.get_state_dir() catch |e| return tp.exit_error(e);
log_file_path.writer().print("{s}/lsp-{s}.log", .{ state_dir, self.tag }) catch |e| return tp.exit_error(e);
self.log_file = std.fs.createFileAbsolute(log_file_path.items, .{ .truncate = true }) catch |e| return tp.exit_error(e);
}