hook

package
v3.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(hookDir string, name string) (string, error)

Find returns the absolute path to the best matching hook file in a path, or os.ErrNotExist if none is found

Types

type HookExitError added in v3.33.3

type HookExitError struct {
	// contains filtered or unexported fields
}

func (*HookExitError) Error added in v3.33.3

func (e *HookExitError) Error() string

type HookScriptChanges added in v3.33.0

type HookScriptChanges struct {
	Diff env.Diff
	// contains filtered or unexported fields
}

func (*HookScriptChanges) GetAfterWd added in v3.33.3

func (changes *HookScriptChanges) GetAfterWd() (string, error)

type ScriptWrapper

type ScriptWrapper struct {
	// contains filtered or unexported fields
}

ScriptWrapper wraps a hook script with env collection and then provides a way to get the difference between the environment before the hook is run and after it

func CreateScriptWrapper

func CreateScriptWrapper(hookPath string) (*ScriptWrapper, error)

CreateScriptWrapper creates and configures a ScriptWrapper. Writes temporary files to the filesystem.

func (*ScriptWrapper) Changes

func (wrap *ScriptWrapper) Changes() (HookScriptChanges, error)

Changes returns the changes in the environment and working dir after the hook script runs

func (*ScriptWrapper) Close

func (wrap *ScriptWrapper) Close()

Close cleans up the wrapper script and the environment files

func (*ScriptWrapper) Path

func (wrap *ScriptWrapper) Path() string

Path returns the path to the wrapper script, this is the one that should be executed

Jump to

Keyboard shortcuts

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