adds type generation
This commit is contained in:
Executable
+16
@@ -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
|
||||
Reference in New Issue
Block a user