From 1fd93fa44bf6ed3cb0690b14c0b580e22ed0327a Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Fri, 8 Nov 2024 00:51:06 -0800 Subject: [PATCH] Print unknown if context path unset --- src/command/current.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/command/current.rs b/src/command/current.rs index 51935c2..b51ffe0 100644 --- a/src/command/current.rs +++ b/src/command/current.rs @@ -12,6 +12,10 @@ pub struct Current {} impl JpreCommand for Current { fn run(self, _context: Context) -> ESResult<(), JpreError> { let path = get_context_path(); + if !path.exists() { + println!(""); + return Ok(()); + } let link_target = std::fs::read_link(&path) .change_context(JpreError::Unexpected) .attach_printable_lazy(|| format!("Failed to read link target of {:?}", path))?;