mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
parent
d53c70cbcd
commit
1e20026ea2
@ -2,6 +2,7 @@ package commands
|
||||
|
||||
import (
|
||||
"github.com/hasura/graphql-engine/cli"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@ -24,7 +25,14 @@ func newMetadataApplyCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
return ec.Validate()
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return opts.run()
|
||||
opts.EC.Spin("Applying metadata...")
|
||||
err := opts.run()
|
||||
opts.EC.Spinner.Stop()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to apply metadata")
|
||||
}
|
||||
opts.EC.Logger.Info("Metadata applied")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,14 @@ func newMetadataClearCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
if cmd.CalledAs() == "reset" {
|
||||
opts.EC.Logger.Warn("metadata reset command is deprecated, use metadata clear instead")
|
||||
}
|
||||
return opts.run()
|
||||
opts.EC.Spin("Clearing metadata...")
|
||||
err := opts.run()
|
||||
opts.EC.Spinner.Stop()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to clear metadata")
|
||||
}
|
||||
opts.EC.Logger.Info("Metadata cleared")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package commands
|
||||
|
||||
import (
|
||||
"github.com/hasura/graphql-engine/cli"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@ -30,7 +31,14 @@ func newMetadataExportCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
return ec.Validate()
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return opts.run()
|
||||
opts.EC.Spin("Exporting metadata...")
|
||||
err := opts.run()
|
||||
opts.EC.Spinner.Stop()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to export metadata")
|
||||
}
|
||||
opts.EC.Logger.Info("Metadata exported")
|
||||
return nil
|
||||
},
|
||||
Long: longHelpMetadataExportCmd,
|
||||
}
|
||||
|
@ -25,7 +25,14 @@ func newMetadataReloadCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
return ec.Validate()
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return opts.run()
|
||||
opts.EC.Spin("Reloading metadata...")
|
||||
err := opts.run()
|
||||
opts.EC.Spinner.Stop()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to reload metadata")
|
||||
}
|
||||
opts.EC.Logger.Info("Metadata reloaded")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user