RezinaLMS-BackEnd/cmd/swagger-export/main.go

23 lines
600 B
Go

// swagger-export builds portable, offline Swagger UI documentation.
package main
import (
"Rezina-Backend/internal/apidocs/offline"
"flag"
"fmt"
"os"
"path/filepath"
)
func main() {
output := flag.String("out", "exports/swagger-offline", "Output directory; a ZIP will be written beside it")
flag.Parse()
archive, err := offline.Export(*output)
if err != nil {
fmt.Fprintln(os.Stderr, "Swagger export failed:", err)
os.Exit(1)
}
fmt.Println("Offline documentation:", filepath.Join(filepath.Dir(archive), filepath.Base(*output), "index.html"))
fmt.Println("ZIP archive:", archive)
}