forked from toolshed/abra
feat: catalogue sync command
This commit is contained in:
@ -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"},
|
||||
|
@ -134,6 +134,7 @@ func Run(version, commit string) {
|
||||
|
||||
catalogue.CatalogueCommand.AddCommand(
|
||||
catalogue.CatalogueGenerateCommand,
|
||||
catalogue.CatalogueSyncCommand,
|
||||
)
|
||||
|
||||
server.ServerCommand.AddCommand(
|
||||
|
Reference in New Issue
Block a user