Feat/configurable paths (#404)

This commit is contained in:
suchmememanyskill
2023-04-25 05:12:42 +02:00
committed by GitHub
parent 4777963b65
commit d6f336d84b
8 changed files with 140 additions and 45 deletions
+16 -1
View File
@@ -35,4 +35,19 @@ async def service_restart(service_name : str) -> bool:
return True # Stubbed
def get_username() -> str:
return os.getlogin()
return os.getlogin()
def get_privileged_path() -> str:
'''On windows, privileged_path is equal to unprivileged_path'''
return get_unprivileged_path()
def get_unprivileged_path() -> str:
path = os.getenv("UNPRIVILEGED_PATH")
if path == None:
path = os.getenv("PRIVILEGED_PATH", os.path.join(os.path.expanduser("~"), "homebrew"))
return path
def get_unprivileged_user() -> str:
return os.getenv("UNPRIVILEGED_USER", os.getlogin())