infra

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BeeepRepoStatusNotifier = &beeepRepoStatusNotifier{}
View Source
var FilesystemRepos domain.GetReposByPathPattern = func(patterns domain.GetPathPatterns) (repos []string, err error) {
	pathPatterns, err := patterns()
	if err != nil {
		return
	}
	for _, pathPattern := range pathPatterns {
		paths, err2 := filepath.Glob(string(pathPattern))
		if err2 != nil {
			return repos, err2
		}
		for _, path := range paths {
			isDir, _ := isDirectory(path + "/.git")
			if isDir {
				repos = append(repos, path)
			}
		}
	}
	return
}
View Source
var GetGitStatus domain.GetGitStatus = func(repo string) (status domain.GitStatus, err error) {
	output, err := git.Status(repo)
	if err != nil {
		return
	}
	hasAheadCommits := hasAheadCommits(output)
	hasUncommittedFiles := hasUncommittedFiles(output)
	if hasUncommittedFiles && hasAheadCommits {
		return domain.NeedToCommitAndPush, err
	} else if hasAheadCommits {
		return domain.NeedToPush, err
	} else if hasUncommittedFiles {
		return domain.NeedToCommit, err
	} else {
		return domain.UpToDate, err
	}
}
View Source
var GitGlobalConfigGetPathPatterns domain.GetPathPatterns = func() (pathPatterns []string, err error) {
	paths, err := git.GetGlobalConfig("remind.paths")
	if err != nil {
		return
	}
	pathPatterns = strings.Split(paths, ",")
	return
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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