From f4a51a88a5225b466cf509d1b085d55f356b9c18 Mon Sep 17 00:00:00 2001 From: Eyad Arafat Date: Wed, 3 Apr 2024 23:30:59 -0500 Subject: [PATCH] refactor: modular schema registration --- tools/generate-register-schemas-function.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/generate-register-schemas-function.sh b/tools/generate-register-schemas-function.sh index e1f3541..59329f8 100755 --- a/tools/generate-register-schemas-function.sh +++ b/tools/generate-register-schemas-function.sh @@ -12,8 +12,7 @@ schemaDir="../src/schemas" outputFile="../src/registerSchemas.ts" # Write the fixed part of the template to the outputFile -echo "" > "$outputFile" -echo "// THIS FILE IS AUTOMATICALLY GENERATED!" >> "$outputFile" +echo "// THIS FILE IS AUTOMATICALLY GENERATED!" > "$outputFile" echo "// using the script tools/generate-register-schemas-function.sh" >> "$outputFile" echo "" >> "$outputFile" echo "import Ajv from 'ajv';" >> "$outputFile" @@ -35,7 +34,7 @@ for file in "$schemaDir"/*.json; do importStatements+="import ${schemaName}Json from './schemas/${filename}';"$'\n' # Create the ajvInstance.addSchema call - schemaCalls+=" ajvInstance.addSchema(${schemaName}Json);"$'\n' + schemaCalls+=" ajvInstance.addSchema(${schemaName}Json);"$'\n' done # Write the dynamic parts to the outputFile