mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 22:57:14 +00:00
fixing pre-run script
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
"""Cleans all django-created files and compiled python. Used by the
|
||||
pre-run.sh script which cleans and initialises everything before
|
||||
@@ -47,7 +48,11 @@ def delete_migrations():
|
||||
if folder.endswith("migrations"):
|
||||
for item in os.listdir(folder):
|
||||
if not item.endswith("__init__.py"):
|
||||
os.remove(os.path.join(folder, item))
|
||||
fullitem = Path(folder, item)
|
||||
if fullitem.is_dir():
|
||||
print(f"__ directory {item} in {folder} not deleted")
|
||||
else:
|
||||
os.remove(os.path.join(folder, item))
|
||||
|
||||
print("All migration files deleted.")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user