Update checker scripts to work correctly from the scripts/ dir

check-swagger-sources also had a bug which caused it to fail while validating the directory
structure of /data/api. This was fixed by @KitsuneRal - thank you!
This commit is contained in:
Andrew Morgan 2021-02-04 20:19:58 +00:00 committed by Richard van der Hoff
parent b8dafe86f4
commit 64231f079d
2 changed files with 54 additions and 17 deletions

View file

@ -128,7 +128,14 @@ def check_example_dir(exampledir, schemadir):
if __name__ == '__main__':
# Get the directory that this script is residing in
script_directory = os.path.dirname(os.path.realpath(__file__))
# Resolve the directories to check, relative to the script path
examples_directory = os.path.join(script_directory, "../event-schemas/examples")
schema_directory = os.path.join(script_directory, "../event-schemas/schema")
try:
check_example_dir("examples", "schema")
check_example_dir(examples_directory, schema_directory)
except:
sys.exit(1)