feat: catalogue sync command

This commit is contained in:
2025-08-18 10:10:52 +02:00
parent 6fad1a1dcc
commit 6e5d09b374
2 changed files with 19 additions and 0 deletions

View File

@ -19,6 +19,24 @@ import (
"github.com/spf13/cobra"
)
var CatalogueSyncCommand = &cobra.Command{
Use: "sync [flags]",
Aliases: []string{"g"},
Short: "Sync recipe catalogue for latest changes",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
if err := catalogue.EnsureCatalogue(); err != nil {
log.Fatal(err)
}
if err := catalogue.EnsureUpToDate(); err != nil {
log.Fatal(err)
}
log.Info("catalogue successfully synced")
},
}
var CatalogueGenerateCommand = &cobra.Command{
Use: "generate [recipe] [flags]",
Aliases: []string{"g"},

View File

@ -134,6 +134,7 @@ func Run(version, commit string) {
catalogue.CatalogueCommand.AddCommand(
catalogue.CatalogueGenerateCommand,
catalogue.CatalogueSyncCommand,
)
server.ServerCommand.AddCommand(