Skip to content

Commit

Permalink
doc2pdf: match
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Dec 13, 2023
1 parent ab279fe commit b49fd2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

def get_lo_exe() -> str:
name = "soffice"
path = None

if os.name == "nt":
path = Path(os.environ["PROGRAMFILES"]) / "LibreOffice/program"
elif sys.platform == "darwin":
path = Path("/Applications/LibreOffice.app/Contents/MacOS")
else:
path = None
match sys.platform:
case "win32":
path = Path(os.environ["PROGRAMFILES"]) / "LibreOffice/program"
case "darwin":
path = Path("/Applications/LibreOffice.app/Contents/MacOS")

if not (exe := shutil.which(name, path=path)):
raise FileNotFoundError("LibreOffice not found")
Expand Down

0 comments on commit b49fd2e

Please sign in to comment.