mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
Merge pull request #3513 from SomberNight/make_dir_testnet
fix: testnet datadir could not be created first
This commit is contained in:
commit
92ebf970ac
1 changed files with 10 additions and 7 deletions
|
@ -85,9 +85,7 @@ class SimpleConfig(PrintError):
|
||||||
if path is None:
|
if path is None:
|
||||||
path = self.user_dir()
|
path = self.user_dir()
|
||||||
|
|
||||||
if self.get('testnet'):
|
def make_dir(path):
|
||||||
path = os.path.join(path, 'testnet')
|
|
||||||
|
|
||||||
# Make directory if it does not yet exist.
|
# Make directory if it does not yet exist.
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
if os.path.islink(path):
|
if os.path.islink(path):
|
||||||
|
@ -95,6 +93,11 @@ class SimpleConfig(PrintError):
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||||
|
|
||||||
|
make_dir(path)
|
||||||
|
if self.get('testnet'):
|
||||||
|
path = os.path.join(path, 'testnet')
|
||||||
|
make_dir(path)
|
||||||
|
|
||||||
self.print_error("electrum directory", path)
|
self.print_error("electrum directory", path)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue