veza/veza-backend-api/cmd/generate-config-docs/main.go

33 lines
777 B
Go
Raw Normal View History

2025-12-03 19:29:37 +00:00
package main
import (
"fmt"
"os"
"path/filepath"
"veza-backend-api/internal/config"
)
func main() {
// Générer la documentation
docs := config.GenerateConfigDocs()
// Déterminer le chemin du fichier (relatif à la racine du projet)
outputPath := filepath.Join("docs", "CONFIGURATION.md")
// Créer le répertoire docs s'il n'existe pas
docsDir := filepath.Dir(outputPath)
if err := os.MkdirAll(docsDir, 0755); err != nil {
fmt.Fprintf(os.Stderr, "Error creating docs directory: %v\n", err)
os.Exit(1)
}
// Écrire le fichier
if err := os.WriteFile(outputPath, []byte(docs), 0644); err != nil {
fmt.Fprintf(os.Stderr, "Error writing file: %v\n", err)
os.Exit(1)
}
fmt.Printf("✅ CONFIGURATION.md generated successfully at %s\n", outputPath)
}