githook

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Hooks a list of all available git hooks
	Hooks = []string{
		"applypatch-msg",
		"commit-msg",
		"post-commit",
		"post-receive",
		"post-update",
		"pre-applypatch",
		"pre-commit",
		"prepare-commit-msg",
		"pre-rebase",
		"update",
	}
)

Functions

This section is empty.

Types

type CommandData

type CommandData struct {
	Path  string
	Hooks []string
}

CommandData contains all command related data

type Githook

type Githook struct {
	Path        string
	Cwd         string
	CommandData *CommandData
}

Githook command to create git hooks

func New

func New(options ...Option) *Githook

New with the given options.

func (*Githook) Run

func (g *Githook) Run() error

Run the command

func (*Githook) StartCommandSurvey

func (g *Githook) StartCommandSurvey() error

StartCommandSurvey collect all required informations from user

type Option

type Option func(*Githook)

Option function.

func WithCommandData

func WithCommandData(cd *CommandData) Option

WithCommandData option.

func WithCwd added in v0.3.1

func WithCwd(dir string) Option

WithCwd option.

Jump to

Keyboard shortcuts

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