Documentation
¶
Index ¶
- Constants
- func CheckForDuplicateSubmodules(allowDuplicateOrigins bool, submodules ...Submodule) error
- func IsOnCaseSensitiveFilesystem(p Path) (bool, error)
- type Checksums
- type Config
- type NestConfig
- type NestContext
- type Path
- func (p *Path) AtRoot() bool
- func (p *Path) BContains(pattern string) bool
- func (p *Path) Base() string
- func (p *Path) Clean() Path
- func (p *Path) Contains(pattern string) (bool, error)
- func (p *Path) Empty() bool
- func (p *Path) EmptyOrAtRoot() bool
- func (p *Path) Equals(other Path) bool
- func (p *Path) Exists() bool
- func (p *Path) IsDir() bool
- func (p *Path) IsFile() bool
- func (p *Path) Join(paths ...Path) Path
- func (p *Path) MarshalText() (text []byte, err error)
- func (p *Path) Parent() Path
- func (p *Path) Parts() []string
- func (p *Path) Relative(o Path) (Path, error)
- func (p *Path) SJoin(paths ...string) Path
- func (p *Path) String() string
- func (p *Path) UnixString() string
- func (p *Path) UnmarshalText(text []byte) error
- func (p *Path) Up() Path
- type Submodule
Constants ¶
const ( NO_EXIST = iota FILE = iota DIR = iota )
Variables ¶
This section is empty.
Functions ¶
func CheckForDuplicateSubmodules ¶
CheckForDuplicateSubmodules syntactically checks if any duplicate submodules exist within a slice of Submodule.
func IsOnCaseSensitiveFilesystem ¶ added in v0.0.2
IsOnCaseSensitiveFilesystem returns whether a given path is on a case-sensitive filesystem.
Types ¶
type Checksums ¶ added in v0.0.2
type Checksums struct {
/*
ConfigurationFile contains the checksum for the `nestmodules.toml` configuration file.
*/
ConfigurationFile string
}
Checksums contains checksums for required files at startup
type Config ¶
type Config struct {
/*
AllowDuplicateOrigins defines whether duplicate remote origins are allowed.
*/
AllowDuplicateOrigins bool `toml:"allow_duplicate_origins"`
/*
AllowUnequalRoots defines whether the project's git root and git-nest root are allowed to not be aligned.
*/
AllowUnequalRoots bool `toml:"allow_unequal_roots"`
}
Config represents all git-nest configurable options.
type NestConfig ¶
type NestConfig struct {
/*
Config contains every configuration flag.
*/
Config Config `toml:"config"`
/*
Submodule contains all Submodule for this configuration.
*/
Submodules []Submodule `toml:"submodule"`
}
NestConfig represents a higher-order configuration for git-nest.
func (NestConfig) Validate ¶
func (c NestConfig) Validate() error
Validate performs validation on this NestConfig.
type NestContext ¶
type NestContext struct {
/*
WorkingDirectory contains the Path to the working directory the binary was executed from.
*/
WorkingDirectory Path
/*
ProjectRoot is a Path to the project's root directory.
A directory counts as project root if a directory contains a `nestmodules.toml` file directly at the
directory or in a `.Config` subdirectory. If no configuration file could be found, the directory tree
is traversed up to find the next possible parent project. If the current directory is not part of a
git-nest project, the string is set to the current working directory.
*/
ProjectRoot Path
/*
GitRepositoryPath is a Path to the project's repository root
*/
GitRepositoryRoot Path
/*
ConfigFileExists defines whether a `nestmodules.toml` configuration file exists.
*/
ConfigFileExists bool
/*
ConfigFile is a Path that points to the project's `nestmodules.toml`.
If no configuration files has found, it points to `[ProjectRoot]/nestmodules.toml`.
*/
ConfigFile Path
/*
Config contains the configuration of the project, read from a configuration file.
*/
Config NestConfig
/*
Checksums contains checksums of every configuration file's contents.
*/
Checksums Checksums
/*
IsGitInstalled defines whether git is installed in the current environment.
*/
IsGitInstalled bool
/*
IsGitRepository defines whether the project root is also a git repository.
*/
IsGitRepository bool
}
NestContext bundles all relevant information of a project that utilizes git-nest.
type Path ¶
type Path string
Path is a string-typed type that abstracts path operations.
func (*Path) AtRoot ¶
AtRoot returns whether this Path is at a root-level-directory or at its top-most parent directory of its original path.
func (*Path) BContains ¶
BContains is a wrapper for Path.Contains and only returns the success boolean value.
func (*Path) Clean ¶
Clean returns an OS-fitting, cleaned up copy of this Path, based on the stdlib filepath.Clean.
func (*Path) Contains ¶
Contains returns whether the passed pattern exist within this Path's directory, based on the stdlib filepath.Glob.
func (*Path) EmptyOrAtRoot ¶
EmptyOrAtRoot returns whether this Path is an empty string, at a root-level-directory or at its top-most parent directory of its original path.
func (*Path) Join ¶
Join returns a new Path with all passed Path structs joined together using filepath.Join. If strings should be joined on this Path, use SJoin.
func (*Path) MarshalText ¶
MarshalText unmarshalls this Path into a string. This is done so that Path implements the encoding.TextMarshaler interface.
func (*Path) Parts ¶
Parts returns all single of the Path. It uses filepath.Separator to split the path string.
func (*Path) Relative ¶
Relative returns the relative path from another Path to this Path, based on the stdlib filepath.Rel.
func (*Path) SJoin ¶
SJoin returns a new Path with all passed strings joined together using filepath.Join.
func (*Path) String ¶
String returns this Path as its base type, removing the need for specific casts.
func (*Path) UnixString ¶
UnixString ensures the path is formatted as a UNIX path (using '/' as path separators).
func (*Path) UnmarshalText ¶
UnmarshalText unmarshalls any byte array into a Path type. This is done so that Path implements the encoding.TextUnmarshaler interface.
type Submodule ¶
func (*Submodule) Clean ¶
func (s *Submodule) Clean()
Clean performs a data cleanup on this Submodule.
func (*Submodule) Identifier ¶
Identifier returns a string to uniquely identify a submodule.
Format: Submodule.Url@Submodule.Ref>Submodule.Path
func (*Submodule) RemoteIdentifier ¶
RemoteIdentifier returns a string to uniquely identify a submodule's remote origin, incl. the reference.
Format: Submodule.Url@Submodule.Ref