Agregar manejo de errrores

ticket-769
Vadim vtroshchinskiy 2024-09-13 09:48:36 +02:00
parent b8012e9909
commit be8979b8bf
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ def home():
@app.route('/repositories')
def get_repositories():
if not os.path.isdir(repositories_base_path):
return jsonify({"error": "Repository storage not found, git functionality may not be installed."}), 500
repos = []
for entry in os.scandir(repositories_base_path):
if entry.is_dir(follow_symlinks=False) and os.path.isfile(os.path.join(entry.path, "HEAD")):