Skip to content

Commit

Permalink
yeet_api: Add support for windows and guard against unsupported OSSes
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimifr committed Jan 25, 2024
1 parent e132dca commit c8f6bbb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions yeet_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@

from pathlib import Path

_home_dir: str

if os.name == "posix":
_home_dir = os.getenv("HOME", "")
elif os.name == "nt":
_home_dir = os.getenv("USERPROFILE", "")
else:
raise OSError("Unsupported OS: yeet-api only supports Windows and unix-like OSses.")

if not shutil.which("git"):
raise FileNotFoundError("Git executable is not found."
"\nFor Windows, install it from https://git-scm.com/downloads"
Expand Down

0 comments on commit c8f6bbb

Please sign in to comment.