Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
Find returns the absolute path to the best matching hook file in a path, or os.ErrNotExist if none is found
func WithHookPath ¶ added in v3.38.0
func WithHookPath(path string) scriptWrapperOpt
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
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 NewScriptWrapper ¶ added in v3.38.0
func NewScriptWrapper(opts ...scriptWrapperOpt) (*ScriptWrapper, error)
NewScriptWrapper 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
Click to show internal directories.
Click to hide internal directories.