Documentation
¶
Index ¶
- func ChainParent(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error
- func CheckLogin(cmd *cobra.Command, args []string) error
- func CheckNodeInstalled(cmd *cobra.Command, args []string) error
- func CheckPnpmInstalled(cmd *cobra.Command, args []string) error
- func Compose(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error
- type CommandCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainParent ¶ added in v0.2.10
func ChainParent(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error
ChainParent combines the parent command's PersistentPreRunE with additional checks This ensures child commands inherit parent middleware while adding their own All errors are returned without printing - error formatting is handled centrally in Execute()
func CheckLogin ¶
CheckLogin checks if the user is logged in and the session is valid
func CheckNodeInstalled ¶ added in v0.2.10
CheckNodeInstalled checks if node is installed in the system path
func CheckPnpmInstalled ¶
CheckPnpmInstalled checks if pnpm is installed in the system path
Types ¶
type CommandCheck ¶
CommandCheck is a function that performs a check before a command is run
func CheckNodeVersion ¶
func CheckNodeVersion(minVersion string) CommandCheck
CheckNodeVersion checks if node is installed and meets the minimum version requirement
func CheckVersion ¶ added in v0.2.10
func CheckVersion(version string) CommandCheck
CheckVersion checks if the CLI version is up to date and handles upgrade prompts