(rootCmd *cobra.Command)
| 78 | const envPrefix = "CHAINLOOP" |
| 79 | |
| 80 | func Execute(rootCmd *cobra.Command) error { |
| 81 | if err := rootCmd.Execute(); err != nil { |
| 82 | // The local file is pointing to the wrong organization, we remove it |
| 83 | if v1.IsUserNotMemberOfOrgErrorNotInOrg(err) { |
| 84 | if err := setLocalOrganization(""); err != nil { |
| 85 | logger.Debug().Err(err).Msg("failed to remove organization from config") |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return err |
| 90 | } |
| 91 | |
| 92 | return nil |
| 93 | } |
| 94 | |
| 95 | func NewRootCmd(l zerolog.Logger) *cobra.Command { |
| 96 | rootCmd := &cobra.Command{ |
no test coverage detected