Do not raise error if folder exists

This commit is contained in:
Benjamin Bohard 2019-12-18 10:08:11 +01:00
parent 62ab525219
commit b006eda133
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class Risotto(Controller):
raise Exception(_('Invalid source'))
else:
releases = {'1.0.0': {'distribution': 'stable'}}
os.makedirs(os.path.join(get_config().get('source').get('root_path'), source_name))
os.makedirs(os.path.join(get_config().get('source').get('root_path'), source_name), exist_ok=True)
with open(os.path.join(get_config().get('source').get('root_path'), source_name, 'releases.yml'), 'w') as release_file:
yaml.dump(releases, release_file)
source_id = await risotto_context.connection.fetchval(source_upsert,