Validate configuration + readable error

Change docker-compose version - use Just to handle version
This commit is contained in:
2023-11-25 01:50:27 +01:00
parent 07dccee235
commit 8dba474e23
2 changed files with 9 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import datetime
import json
import os
import smtplib
import sys
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@@ -36,7 +37,13 @@ def main():
parser.read(conf_file)
default_config = parser["config"]
projects = json.loads(parser.get("projects", "projects"))
try:
projects = json.loads(parser.get("projects", "projects"))
except json.decoder.JSONDecodeError as jse:
print("ERROR: config file is not correctly JSON formatted!", end="\n\t")
print(jse)
sys.exit(1)
new_releases = []
new_projects = []