adds type generation

This commit is contained in:
2025-07-19 18:37:41 +02:00
parent ef0f82d516
commit 7c92b33f91
5 changed files with 33 additions and 19 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
if [ -z "$1" ]; then
set -- "BACKEND_HOST"
fi
HOST=$(grep "$1" .env 2>/dev/null | cut -d '=' -f 2 | tr -d '"')
echo $1
echo $HOST
cmd="npx openapi-typescript $HOST/api/schema/ -o src/data/types.tmp.ts"
if eval $cmd
then
echo $cmd
mv src/data/types.tmp.ts src/data/types.ts
fi
chmod go+rw src/data/types.ts