lefthook

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(opts *Options, args *AddArgs) error

func Install

func Install(opts *Options, args *InstallArgs) error

Install installs the hooks from config file to the .git/hooks.

func Run

func Run(opts *Options, args RunArgs, hookName string, gitArgs []string) error

func Uninstall

func Uninstall(opts *Options, args *UninstallArgs) error

Types

type AddArgs

type AddArgs struct {
	Hook string

	CreateDirs, Force bool
}

type InstallArgs

type InstallArgs struct {
	Force, Aggressive bool
}

type Lefthook

type Lefthook struct {
	// Since we need to support deprecated global options Force and Aggressive
	// we need to store these fields. After their removal we need just to copy fs.
	*Options
	// contains filtered or unexported fields
}

func (*Lefthook) Add

func (l *Lefthook) Add(args *AddArgs) error

Creates a hook, given in args. The hook is a Lefthook hook.

func (*Lefthook) Install

func (l *Lefthook) Install(args *InstallArgs) error

func (*Lefthook) Run

func (l *Lefthook) Run(hookName string, args RunArgs, gitArgs []string) error

func (*Lefthook) Uninstall

func (l *Lefthook) Uninstall(args *UninstallArgs) error

type Options

type Options struct {
	Fs                afero.Fs
	Verbose, NoColors bool

	// DEPRECATED. Will be removed in 1.3.0.
	Force, Aggressive bool
}

type RunArgs added in v1.2.5

type RunArgs struct {
	NoTTY bool
}

type UninstallArgs

type UninstallArgs struct {
	Force, RemoveConfig bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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