Skip to content
Snippets Groups Projects
Commit 3b872988 authored by Shawn Presser's avatar Shawn Presser
Browse files

Add support for macOS

parent eecd09cc
No related branches found
No related tags found
No related merge requests found
......@@ -119,10 +119,8 @@ def get_path_from_template(path_template: str, path_type: PathType = PathType.AU
if path_type == PathType.AUTO:
if platform.system() == "Windows":
path_type = PathType.WINDOWS
elif platform.system() == "Linux":
path_type = PathType.LINUX
else:
raise RuntimeError("Unknown platform")
path_type = PathType.LINUX
path_template = path_template.replace("<USERNAME>", get_user_name())
......@@ -160,15 +158,12 @@ def get_user_name():
return _user_name_override
elif platform.system() == "Windows":
return os.getlogin()
elif platform.system() == "Linux":
else:
try:
import pwd
return pwd.getpwuid(os.geteuid()).pw_name
import pwd # pylint: disable=import-error
return pwd.getpwuid(os.geteuid()).pw_name # pylint: disable=no-member
except:
return "unknown"
else:
raise RuntimeError("Unknown platform")
def make_run_dir_path(*paths):
"""Make a path/filename that resides under the current submit run_dir.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment