From fe192be798ac1a9bd13983d197cb5775b7da2ad5 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 11 Sep 2013 16:36:31 +0200 Subject: [PATCH] Add a SUGAR_HOME environment variable We should really use XDG directories but that will be a bit more complicated and require migration scripts. This is a short time solution to "expose" the dot sugar directory in sugar-build. --- src/sugar3/env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sugar3/env.py b/src/sugar3/env.py index a544cc23..a18d5c93 100644 --- a/src/sugar3/env.py +++ b/src/sugar3/env.py @@ -32,7 +32,8 @@ def is_emulator(): def get_profile_path(path=None): profile_id = os.environ.get('SUGAR_PROFILE', 'default') - base = os.path.join(os.path.expanduser('~/.sugar'), profile_id) + home_dir = os.environ.get('SUGAR_HOME', os.path.expanduser('~/.sugar')) + base = os.path.join(home_dir, profile_id) if not os.path.isdir(base): try: os.makedirs(base, 0770)