setproject

package
v0.22.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SetProjectCmd = &cobra.Command{
	Use:   "set-project <id/alternate_id>",
	Short: "Set the defaultd project",
	Long:  `Set the default project for the Hyphen CLI to use.`,
	Args:  cobra.MaximumNArgs(1),
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		return user.ErrorIfNotAuthenticated()
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		printer = cprint.NewCPrinter(flags.VerboseFlag)
		organizationID, err := flags.GetOrganizationID()
		projectID := ""
		if len(args) > 0 {
			projectID = args[0]
		}
		if err != nil {
			printer.Error(cmd, fmt.Errorf("failed to get organization ID: %v", err))
			return err
		}

		return SetProject(cmd, organizationID, projectID)

	},
}

Functions

func SetProject added in v0.22.0

func SetProject(cmd *cobra.Command, organizationID, projectID string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL