16 lines
356 B
Bash
16 lines
356 B
Bash
#!/usr/bin/env bash
|
|
# Regenerate swagger docs reliably. Run from project root.
|
|
set -euo pipefail
|
|
|
|
# Ensure swag is installed
|
|
if ! command -v swag >/dev/null 2>&1; then
|
|
echo "swag not found. Install: go install github.com/swaggo/swag/cmd/swag@latest"
|
|
exit 1
|
|
fi
|
|
|
|
# Generate docs
|
|
swag init -g main.go -o docs
|
|
|
|
echo "Swagger docs regenerated into ./docs"
|
|
|