From c1212307063723e3fa0d13c6d05798e9a5d1a111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81ukasiewicz?= Date: Tue, 25 Feb 2020 16:28:53 +0100 Subject: [PATCH] Added ELECTRUMDIR env variable (#5543) Simple way for allowing users to change localization of Electrum directory from ~/.electrum to somewhere else --- electrum/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/util.py b/electrum/util.py index b0f0de7d3..829132127 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -566,7 +566,9 @@ def xor_bytes(a: bytes, b: bytes) -> bytes: def user_dir(): - if 'ANDROID_DATA' in os.environ: + if "ELECTRUMDIR" in os.environ: + return os.environ["ELECTRUMDIR"] + elif 'ANDROID_DATA' in os.environ: return android_data_dir() elif os.name == 'posix': return os.path.join(os.environ["HOME"], ".electrum")