fix
This commit is contained in:
parent
7be0209169
commit
584af01366
10
server.py
10
server.py
@ -79,14 +79,18 @@ async def create_upload_file(file: UploadFile | None, package: Annotated[str, Fo
|
||||
os.makedirs(dir_last)
|
||||
if not os.path.exists(dir_stable):
|
||||
os.makedirs(dir_stable)
|
||||
os.remove(f"{dir_file}/{filename}")
|
||||
|
||||
if os.path.exists(f"{dir_file}/{filename}"):
|
||||
os.remove(f"{dir_file}/{filename}")
|
||||
with open(f"{dir_file}/{filename}", 'a') as f:
|
||||
f.write(str(contents))
|
||||
os.remove(f"{dir_last}/{filename}")
|
||||
if os.path.exists(f"{dir_last}/{filename}"):
|
||||
os.remove(f"{dir_last}/{filename}")
|
||||
with open(f"{dir_last}/{filename}", 'a') as f:
|
||||
f.write(str(contents))
|
||||
if stable:
|
||||
os.remove(f"{dir_stable}/{filename}")
|
||||
if os.path.exists(f"{dir_stable}/{filename}"):
|
||||
os.remove(f"{dir_stable}/{filename}")
|
||||
with open(f"{dir_stable}/{filename}", 'a') as f:
|
||||
f.write(str(contents))
|
||||
except Exception as err:
|
||||
|
Loading…
Reference in New Issue
Block a user