Path: blob/main/dev/preview/previewctl/cmd/get_name.go
2500 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package cmd56import (7"fmt"8"github.com/spf13/cobra"910"github.com/gitpod-io/gitpod/previewctl/pkg/preview"11)1213func newGetNameCmd() *cobra.Command {14cmd := &cobra.Command{15Use: "get-name",16Short: "Returns the name of the preview for the corresponding branch.",17RunE: func(cmd *cobra.Command, args []string) error {18previewName, err := preview.GetName(branch)19if err != nil {20return err21}2223fmt.Println(previewName)2425return nil26},27}2829return cmd30}313233