githook

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 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
	GitDir      string
	CommandData *CommandData
}

Githook command to create git hooks

func New

func New(options ...Option) *Githook

New with the given options.

func (*Githook) Install

func (g *Githook) Install() error

Install will create hard links from local git_hooks to the corresponding git hooks

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 WithGitDir added in v0.0.21

func WithGitDir(dir string) Option

WithGitDir option.

Jump to

Keyboard shortcuts

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