Commit ce74aa90 authored by Mattia Rizzolo's avatar Mattia Rizzolo

Make possible to start without a details.json file

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 1c3a6d1a
...@@ -58,12 +58,19 @@ def is_root_valid(path): ...@@ -58,12 +58,19 @@ def is_root_valid(path):
print('There is a branches file conflicting with the expected directory') print('There is a branches file conflicting with the expected directory')
return False return False
# TODO make possible to start without these two files # details.json file
required_files = ["config.json", "details.json"] file = path / 'details.json'
for file in required_files: if not file.exists():
file = path / file with open(file, 'w') as f:
if not (file.exists() and file.is_file()): f.write('{"branches":{}}')
print("The required file %s does not exist" % file) elif not file.is_file():
return False print('There is a details.json non-file conflicting with the expectations.')
return False
# TODO make possible to start without this file
file = path / 'config.json'
if not (file.exists() and file.is_file()):
print("The required file %s does not exist" % file)
return False
return True return True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment