reflect current directory in logs

This commit is contained in:
Emil Lerch 2022-01-06 14:00:48 -08:00
parent dd37ce3185
commit 88cfd0901a
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -80,7 +80,9 @@ pub fn clipboardChanged(self: *Self, contents: []const u8) !void {
fn getKey(allocator: std.mem.Allocator) !*[crypt.key_size]u8 {
const passfile = std.fs.cwd().openFile(".clippy", .{}) catch |e| {
if (e == error.FileNotFound) {
std.log.err("Could not find '.clippy' file. Please add a password to this file", .{});
const cwd = std.fs.realpathAlloc(allocator, ".") catch "could not determine";
defer allocator.free(cwd);
std.log.err("Could not find '.clippy' file in directory {s}. Please add a password to this file", .{cwd});
}
return e;
};