Browse Source

Merge pull request #3513 from SomberNight/make_dir_testnet

fix: testnet datadir could not be created first
master
ThomasV 8 years ago committed by GitHub
parent
commit
92ebf970ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      lib/simple_config.py

17
lib/simple_config.py

@ -85,15 +85,18 @@ class SimpleConfig(PrintError):
if path is None: if path is None:
path = self.user_dir() path = self.user_dir()
def make_dir(path):
# Make directory if it does not yet exist.
if not os.path.exists(path):
if os.path.islink(path):
raise BaseException('Dangling link: ' + path)
os.mkdir(path)
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
make_dir(path)
if self.get('testnet'): if self.get('testnet'):
path = os.path.join(path, 'testnet') path = os.path.join(path, 'testnet')
make_dir(path)
# Make directory if it does not yet exist.
if not os.path.exists(path):
if os.path.islink(path):
raise BaseException('Dangling link: ' + path)
os.mkdir(path)
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
self.print_error("electrum directory", path) self.print_error("electrum directory", path)
return path return path

Loading…
Cancel
Save