这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cli/commands/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions cli/commands/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions cli/commands/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions cli/commands/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
}
Expand Down
5 changes: 2 additions & 3 deletions cli/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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()
Expand Down