mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
cli: send command path in telemetry data (#4095)
This commit is contained in:
parent
94b3550d15
commit
13e8a3c010
@ -25,6 +25,7 @@
|
||||
|
||||
### Other changes
|
||||
|
||||
- cli: fix command path not being set in telemetry data (close #4127)
|
||||
- fix deploy script to upload github release assets
|
||||
- cli: fix parse error returned on console api (close #4126)
|
||||
- console and cli-ext: fix parsing of wrapped types in SDL
|
||||
|
@ -20,6 +20,7 @@ func NewActionsCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
Short: "Manage actions on hasura",
|
||||
SilenceUsage: true,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
cmd.Root().PersistentPreRun(cmd, args)
|
||||
ec.Viper = v
|
||||
err := ec.Prepare()
|
||||
if err != nil {
|
||||
|
@ -16,6 +16,7 @@ func NewMetadataCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
Aliases: []string{"md"},
|
||||
Short: "Manage Hasura GraphQL Engine metadata saved in the database",
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
cmd.Root().PersistentPreRun(cmd, args)
|
||||
ec.Viper = v
|
||||
err := ec.Prepare()
|
||||
if err != nil {
|
||||
|
@ -36,6 +36,7 @@ func NewMigrateCmd(ec *cli.ExecutionContext) *cobra.Command {
|
||||
Short: "Manage migrations on the database",
|
||||
SilenceUsage: true,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
cmd.Root().PersistentPreRun(cmd, args)
|
||||
ec.Viper = v
|
||||
err := ec.Prepare()
|
||||
if err != nil {
|
||||
|
@ -48,6 +48,7 @@ https://github.com/hasura/cli-plugins-index
|
||||
Please open pull requests against this repo to add new plugins`,
|
||||
SilenceUsage: true,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
cmd.Root().PersistentPreRun(cmd, args)
|
||||
return ec.PluginsConfig.Repo.EnsureCloned()
|
||||
},
|
||||
}
|
||||
|
@ -34,8 +34,6 @@ var rootCmd = &cobra.Command{
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
ec.Telemetry.Command = cmd.CommandPath()
|
||||
|
||||
if cmd.Use != updateCLICmdUse {
|
||||
if update.ShouldRunCheck(ec.LastUpdateCheckFile) && ec.GlobalConfig.ShowUpdateNotification && !ec.SkipUpdateCheck {
|
||||
u := &updateOptions{
|
||||
@ -116,10 +114,11 @@ func Execute() error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "preparing execution context failed")
|
||||
}
|
||||
err = NewDefaultHasuraCommand().Execute()
|
||||
execCmd, err := NewDefaultHasuraCommand().ExecuteC()
|
||||
if err != nil {
|
||||
ec.Telemetry.IsError = true
|
||||
}
|
||||
ec.Telemetry.Command = execCmd.CommandPath()
|
||||
ec.Telemetry.Beam()
|
||||
if ec.Spinner != nil {
|
||||
ec.Spinner.Stop()
|
||||
|
Loading…
Reference in New Issue
Block a user