1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/.husky/pre-commit
Gastón Fournier da41d3dbcf
chore: automate openapi schema list (#6463)
## About the changes
This PR automates the generation of exported open api schemas on
pre-commit, removing some manual steps and also standardizing the
process. The schema list definition now looks way simpler:

b6f3877296/src/lib/openapi/index.ts (L37-L49)

Also added
2817e66b29/src/lib/openapi/spec/index.ts (L1-L4)
for devs
2024-03-08 14:58:22 +01:00

11 lines
315 B
Bash
Executable File

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
node .husky/update-openapi-spec-list.js
# Check if the src/lib/openapi/spec/index.ts file was modified and if so, add it to the commit
if git ls-files -m | grep -q "src/lib/openapi/spec/index.ts"; then
git add src/lib/openapi/spec/index.ts
fi