From 88cfd0901aa36c6fe6d7b11edcb17074b5714ab1 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 6 Jan 2022 14:00:48 -0800 Subject: [PATCH] reflect current directory in logs --- src/clipboard.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clipboard.zig b/src/clipboard.zig index 52e05da..bcbeb07 100644 --- a/src/clipboard.zig +++ b/src/clipboard.zig @@ -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; };