Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GitProviderCmd = &cobra.Command{ Use: "git-providers", Aliases: []string{"git-provider"}, Short: "Lists your registered Git providers", Run: func(cmd *cobra.Command, args []string) { apiClient, err := server.GetApiClient(nil) if err != nil { log.Fatal(err) } gitProviders, res, err := apiClient.GitProviderAPI.ListGitProviders(context.Background()).Execute() if err != nil { log.Fatal(apiclient.HandleErrorResponse(res, err)) } if len(gitProviders) == 0 { views.RenderInfoMessage("No git providers registered. Add a new git provider by preparing a Personal Access Token and running 'daytona git-providers add'") return } views.RenderMainTitle("Registered Git providers:") supportedProviders := config.GetSupportedGitProviders() var gitProviderViewList []gitprovider_view.GitProviderView for _, gitProvider := range gitProviders { for _, supportedProvider := range supportedProviders { if *gitProvider.Id == supportedProvider.Id { gitProviderViewList = append(gitProviderViewList, gitprovider_view.GitProviderView{ Id: *gitProvider.Id, Name: supportedProvider.Name, Username: *gitProvider.Username, }, ) } } } if output.FormatFlag != "" { output.Output = gitProviderViewList return } for _, gitProviderView := range gitProviderViewList { views.RenderListLine(fmt.Sprintf("%s (%s)", gitProviderView.Name, gitProviderView.Username)) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.