From 77fbdfbb5310168f73575f8101fab03fd557b387 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Aug 2022 13:54:14 +0530 Subject: [PATCH] Fix finding local docs when running from source on macOS --- kitty/constants.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/constants.py b/kitty/constants.py index d1f9a2318..1cd6e4538 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -257,6 +257,9 @@ def clear_handled_signals(*a: Any) -> None: def local_docs() -> str: d = os.path.dirname base = d(d(kitty_exe())) + from_source = getattr(sys, 'kitty_run_data').get('from_source') + if is_macos and from_source and '/kitty.app/Contents/' in kitty_exe(): + base = d(d(d(base))) subdir = os.path.join('doc', 'kitty', 'html') linux_ans = os.path.join(base, 'share', subdir) if getattr(sys, 'frozen', False): @@ -265,7 +268,7 @@ def local_docs() -> str: return linux_ans if os.path.isdir(linux_ans): return linux_ans - if getattr(sys, 'kitty_run_data').get('from_source'): + if from_source: sq = os.path.join(d(base), 'docs', '_build', 'html') if os.path.isdir(sq): return sq