diff options
Diffstat (limited to '')
-rw-r--r-- | project/os.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/project/os.py b/project/os.py index eaa63db..cb5bd44 100644 --- a/project/os.py +++ b/project/os.py @@ -11,6 +11,7 @@ class OS(Enum): WINDOWS = 'Windows' LINUX = 'Linux' CYGWIN = 'Cygwin' + MACOS = 'macOS' def __str__(self): return str(self.value) @@ -22,6 +23,8 @@ class OS(Enum): return OS.WINDOWS if system == 'Linux': return OS.LINUX + if system == 'Darwin': + return OS.MACOS if system.startswith('CYGWIN_NT'): return OS.CYGWIN raise NotImplementedError(f'unsupported OS: {system}') @@ -42,7 +45,7 @@ def on_linux(): def on_linux_like(): os = OS.current() - return os is OS.LINUX or os is OS.CYGWIN + return os is OS.LINUX or os is OS.CYGWIN or os is OS.MACOS def on_cygwin(): |