mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-24 23:09:42 -05:00
Use XDG_CONFIG_HOME environment variable if it is present, otherwise fall back to ~/.config
This commit is contained in:
parent
470fb2bda3
commit
fe64d40e45
@ -133,12 +133,20 @@ class Common:
|
||||
except:
|
||||
# If for some reason we don't have the 'APPDATA' environment variable
|
||||
# (like running tests in Linux while pretending to be in Windows)
|
||||
try:
|
||||
xdg_config_home = os.environ["XDG_CONFIG_HOME"]
|
||||
onionshare_data_dir = f"{xdg_config_home}/onionshare"
|
||||
except:
|
||||
onionshare_data_dir = os.path.expanduser("~/.config/onionshare")
|
||||
elif self.platform == "Darwin":
|
||||
onionshare_data_dir = os.path.expanduser(
|
||||
"~/Library/Application Support/OnionShare"
|
||||
)
|
||||
else:
|
||||
try:
|
||||
xdg_config_home = os.environ["XDG_CONFIG_HOME"]
|
||||
onionshare_data_dir = f"{xdg_config_home}/onionshare"
|
||||
except:
|
||||
onionshare_data_dir = os.path.expanduser("~/.config/onionshare")
|
||||
|
||||
# Modify the data dir if running tests
|
||||
|
Loading…
Reference in New Issue
Block a user