feat: catalogue sync command

This commit is contained in:
2025-08-18 10:10:52 +02:00
parent 4e205cf13e
commit a5104336a2
3 changed files with 40 additions and 0 deletions

View File

@ -20,6 +20,24 @@ import (
"github.com/spf13/cobra"
)
var CatalogueSyncCommand = &cobra.Command{
Use: i18n.G("sync [flags]"),
Aliases: []string{i18n.G("g")},
Short: i18n.G("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(i18n.G("catalogue successfully synced"))
},
}
var CatalogueGenerateCommand = &cobra.Command{
Use: i18n.G("generate [recipe] [flags]"),
Aliases: []string{i18n.G("g")},

View File

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