Store data in Application Support if running from Library

This commit is contained in:
shortcutme 2017-01-24 16:36:51 +01:00
parent 6271fb9218
commit 0f0cf18f92
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.5.1"
self.rev = 1839
self.rev = 1838
self.argv = argv
self.action = None
self.config_file = "zeronet.conf"
@ -65,7 +65,7 @@ class Config(object):
if this_file.endswith("/Contents/Resources/core/src/Config.py"):
# Running as ZeroNet.app
if this_file.startswith("/Application") or this_file.startswith("/private"):
if this_file.startswith("/Application") or this_file.startswith("/private") or this_file.startswith(os.path.expanduser("~/Library")):
# Runnig from non-writeable directory, put data to Application Support
start_dir = os.path.expanduser("~/Library/Application Support/ZeroNet").decode(sys.getfilesystemencoding())
else: