internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIMenu

func CLIMenu(
	config *Config,
) *cobra.Command

func CheckGitAndHooksDir

func CheckGitAndHooksDir() error

func ExecuteCommand

func ExecuteCommand(command string, args ...string) (string, error)

func ExecuteGitCommand

func ExecuteGitCommand(args ...string) (string, error)

Function to execute git commands

func GetCurrentBranchName

func GetCurrentBranchName() (string, error)

func GetGlobalBinPath

func GetGlobalBinPath() (string, error)

func SetCommitMsgHook added in v0.2.0

func SetCommitMsgHook(config *Config) error

func SetGitHooks added in v0.2.0

func SetGitHooks(config *Config) error
    fmt.Println("Git hook script set successfully.")
    return nil
}

configures all necessary Git hooks

func SetPostCheckoutHook added in v0.2.0

func SetPostCheckoutHook(config *Config) error

Types

type Config

type Config struct {
	AutoLink      bool   // Enable automatic JIRA key linking from branch name
	JiraKey       string // Default JIRA key if provided
	BranchPattern string // The pattern to use for matching JIRA keys in branch names
	HookPath      string // Path to the Git hooks directory
}

func NewConfig

func NewConfig() *Config

New returns a new Config instance with default settings.

type JiraManager

type JiraManager struct {
	Config *Config
}

JiraManager handles operations related to JIRA issues.

func NewJiraManager

func NewJiraManager(config *Config) *JiraManager

NewJiraManager creates a new instance of JiraManager with the provided configuration.

func (*JiraManager) ExtractIssueKeyFromBranchName

func (jm *JiraManager) ExtractIssueKeyFromBranchName(branchName string) (string, error)

func (*JiraManager) ValidateJiraKey

func (jm *JiraManager) ValidateJiraKey(
	input string,
) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳