Fix finding local docs when running from source on macOS
This commit is contained in:
parent
214416f1e3
commit
77fbdfbb53
@ -257,6 +257,9 @@ def clear_handled_signals(*a: Any) -> None:
|
|||||||
def local_docs() -> str:
|
def local_docs() -> str:
|
||||||
d = os.path.dirname
|
d = os.path.dirname
|
||||||
base = d(d(kitty_exe()))
|
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')
|
subdir = os.path.join('doc', 'kitty', 'html')
|
||||||
linux_ans = os.path.join(base, 'share', subdir)
|
linux_ans = os.path.join(base, 'share', subdir)
|
||||||
if getattr(sys, 'frozen', False):
|
if getattr(sys, 'frozen', False):
|
||||||
@ -265,7 +268,7 @@ def local_docs() -> str:
|
|||||||
return linux_ans
|
return linux_ans
|
||||||
if os.path.isdir(linux_ans):
|
if os.path.isdir(linux_ans):
|
||||||
return 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')
|
sq = os.path.join(d(base), 'docs', '_build', 'html')
|
||||||
if os.path.isdir(sq):
|
if os.path.isdir(sq):
|
||||||
return sq
|
return sq
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user