Documentation ¶
Index ¶
- Constants
- func CheckTemplateDir(targetDir string, subFolderIfExists string) (string, error)
- func FindHookTemplateDir(useCoreHooksPath bool) (hooksTemplateDir string, err error)
- func GetHookDisableCallback(log cm.ILogContext, nonInteractive bool, uiSettings *UISettings) func(file string) hooks.HookDisableOption
- func InstallIntoRepo(log cm.ILogContext, repoGitDir string, nonInteractive bool, dryRun bool, ...) bool
- func LoadInstallDir(log cm.ILogContext) (installDir string)
- func PromptExistingRepos(log cm.ILogContext, nonInteractive bool, uninstall bool, ...)
- func PromptRegisteredRepos(log cm.ILogContext, dirs []string, nonInteractive bool, uninstall bool, ...)
- func UninstallFromRepo(log cm.ILogContext, gitDir string, lfsAvailable bool, cleanArtefacts bool) bool
- type GitDirsSearchTask
- type PreCommitSearchTask
- type UISettings
Constants ¶
const ( // SortSearchResults defines if all glob searches are sorted, // for reprducible tests this is crucial. SortSearchResults = false )
Variables ¶
This section is empty.
Functions ¶
func CheckTemplateDir ¶
CheckTemplateDir checks the target directory and if valid returns the target hook template directory otherwise empty. If an error occures the directory is empty.
func FindHookTemplateDir ¶
FindHookTemplateDir finds the hook template directory.
func GetHookDisableCallback ¶
func GetHookDisableCallback( log cm.ILogContext, nonInteractive bool, uiSettings *UISettings) func(file string) hooks.HookDisableOption
GetHookDisableCallback returns the callback for prompting about hook disabling during install procedure.
func InstallIntoRepo ¶
func InstallIntoRepo( log cm.ILogContext, repoGitDir string, nonInteractive bool, dryRun bool, skipReadme bool, uiSettings *UISettings) bool
InstallIntoRepo installs run-wrappers into a repositories It prompts for disabling detected LFS hooks and offers to setup a README file.
func LoadInstallDir ¶
func LoadInstallDir(log cm.ILogContext) (installDir string)
LoadInstallDir loads the install directory and uses a default if it does not exist.
func PromptExistingRepos ¶
func PromptExistingRepos( log cm.ILogContext, nonInteractive bool, uninstall bool, promptCtx prompt.IContext, callback func(string))
PromptExistingRepos shows user prompts about installing/uninstalling into existing repositories.
func PromptRegisteredRepos ¶
func PromptRegisteredRepos( log cm.ILogContext, dirs []string, nonInteractive bool, uninstall bool, promptCtx prompt.IContext, callback func(string))
PromptRegisteredRepos shows user prompts about installing/uninstalling into registered repositories.
func UninstallFromRepo ¶
func UninstallFromRepo( log cm.ILogContext, gitDir string, lfsAvailable bool, cleanArtefacts bool) bool
UninstallFromRepo uninstalls run-wrappers from the repositories Git directory. LFS hooks will be reinstalled if available.
Types ¶
type GitDirsSearchTask ¶
GitDirsSearchTask holds data for searching Git directories.
func (*GitDirsSearchTask) Clone ¶
func (t *GitDirsSearchTask) Clone() cm.ITask
Clone clones the task. Necessary for safe Go routine execution.
func (*GitDirsSearchTask) Run ¶
func (t *GitDirsSearchTask) Run(exitCh chan bool) (err error)
Run searches Git directories.
type PreCommitSearchTask ¶
PreCommitSearchTask is a task to search for pre-commit files.
func (*PreCommitSearchTask) Clone ¶
func (t *PreCommitSearchTask) Clone() cm.ITask
Clone clones the task. Necessary for safe Go routine execution.
func (*PreCommitSearchTask) Run ¶
func (t *PreCommitSearchTask) Run(exitCh chan bool) (err error)
Run runs the search task of finding `pre-commit.sample` files.
type UISettings ¶
type UISettings struct { // A prompt context which enables showing a prompt. PromptCtx prompt.IContext // Cached answer for the readme setup prompt. AnswerSetupIncludedReadme string // Cached answer for the LFS detection prompt. DeleteDetectedLFSHooks string }
UISettings defines user interface settings made by the user over prompts.