-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Build scripts for multiple schemas
- Loading branch information
1 parent
f1d51c6
commit a858bfd
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
echo "Running build-schema script..." | ||
|
||
# Use environment variable VERSION, defaulting to "@next" if not set | ||
version="${VERSION:-@next}" | ||
|
||
echo "Version set to $version" | ||
|
||
dirs=("digitalPlanningApplication") | ||
types=("DigitalPlanningApplication") | ||
|
||
for i in "${!dirs[@]}"; do | ||
dir=${dirs[$i]} | ||
type=${types[$i]} | ||
|
||
echo "Building schema for $type from directory /$dir" | ||
|
||
pnpm ts-json-schema-generator --path "types/schemas/${dir}/*.ts" --out "schemas/${dir}.json" --type "$type" --id "$version" --no-top-ref | ||
done |