Skip to content

Commit

Permalink
Make a directory safely without raising error (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt authored Apr 30, 2023
1 parent 66c4ac6 commit 8a1ea48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spkrepo/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ def post(self):
try:
data_path = current_app.config["DATA_PATH"]
if create_package:
os.mkdir(os.path.join(data_path, package.name))
os.makedirs(os.path.join(data_path, package.name), exist_ok=True)
if create_version:
os.mkdir(os.path.join(data_path, package.name, str(version.version)))
os.makedirs(os.path.join(data_path, package.name, str(version.version)), exist_ok=True)
for size, icon in build.version.icons.items():
icon.save(spk.icons[size])
build.save(spk.stream)
Expand Down

0 comments on commit 8a1ea48

Please sign in to comment.