Documentation ¶
Index ¶
- func CompileDirPath(root, repoDirTree string) string
- func FindGitDirs(root string) ([]string, error)
- func NormalizeRepoURL(repoURL string) (string, error)
- func SetUserPaths(ctx context.Context, paths *UserPaths) context.Context
- func WriteExecFile(scriptPath, content string) error
- type LocalRepoPath
- type RepoList
- type UserPaths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileDirPath ¶
CompileDirPath prefixes a directory tree with constant roots. it expects input to be normalized with NormalizeRepoURL.
func FindGitDirs ¶
FindGitDirs uses filepath.Walk to recursively identify git repos, returning the slice of git paths repos are identified as `parent directory of a .git directory`.
func NormalizeRepoURL ¶
NormalizeRepoURL normalizes repoURL to a partial directory tree. repoURL is a git clone url, and resulting string is safe for os.MkdirAll it handles removing/replacing ports, protocols, git users, .git suffix, and other conversions.
func SetUserPaths ¶ added in v0.0.8
func WriteExecFile ¶ added in v0.0.8
WriteExecFile is used to write temporary shell scripts with +x . It should not be used for general file-writing.
Types ¶
type LocalRepoPath ¶
type LocalRepoPath struct {
// contains filtered or unexported fields
}
LocalRepoPath represents a directory path string with or without a common prefix stripped.
func NewLocalRepoPath ¶
func NewLocalRepoPath(root, full string) *LocalRepoPath
func (*LocalRepoPath) Long ¶
func (rp *LocalRepoPath) Long() string
Long returns the full, unmodified directory path.
func (*LocalRepoPath) Path ¶ added in v0.0.8
func (rp *LocalRepoPath) Path(full bool) string
Path returns the dir path. <full> determines if the full or short path is returned
func (*LocalRepoPath) Short ¶
func (rp *LocalRepoPath) Short() string
Short returns the dir path with common prefix trimmed.
type RepoList ¶
type RepoList map[string]*LocalRepoPath
RepoList is a string-indexed map of *LocalRepoPath.
func NewRepoList ¶
type UserPaths ¶ added in v0.0.8
type UserPaths struct { // OwnBinaryName is the name of this binary, as installed/executed OwnBinaryName string // user os' home dir UserHomeDir string // user os' cache dir UserCacheDir string // path to cd shell script. this sh is updated as part of the cd subcommand CDScriptPath string // CollectionRoot is the root path for all git dirs CollectionRoot string }
UserPaths stores root-level paths used by the application