Merge pull request 'dirs: fix user_config_dir on macos' (#59) from cli-prep into main
This commit is contained in:
@@ -17,10 +17,10 @@ def get_clan_flake_toplevel() -> Path:
|
|||||||
raise ClanError("Could not find clan flake toplevel directory")
|
raise ClanError("Could not find clan flake toplevel directory")
|
||||||
|
|
||||||
|
|
||||||
def user_data_dir() -> Path:
|
def user_config_dir() -> Path:
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
raise NotImplementedError("Windows is not supported")
|
return Path(os.getenv("APPDATA", os.path.expanduser("~\\AppData\\Roaming\\")))
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
return Path(os.path.expanduser("~/Library/Application Support/"))
|
return Path(os.path.expanduser("~/Library/Application Support/"))
|
||||||
else:
|
else:
|
||||||
return Path(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")))
|
return Path(os.getenv("XDG_CONFIG_HOME", os.path.expanduser("~/.config")))
|
||||||
|
|||||||
Reference in New Issue
Block a user