install

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func CheckTemplateDir(targetDir string, subFolderIfExists string) (string, error)

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

func FindHookTemplateDir(useCoreHooksPath bool) (hooksTemplateDir string, err error)

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

type GitDirsSearchTask struct {
	Dir     string
	Matches []string
}

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

type PreCommitSearchTask struct {
	Dir     string
	Matches []string
}

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.

Jump to

Keyboard shortcuts

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