mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
c465b0f2ff
This prevents commands like "go test ./..." from looking into it, and it prevents VS Code's Problems panel from showing errors about the go files in that folder.
37 lines
1007 B
Go
37 lines
1007 B
Go
package components
|
|
|
|
import "path/filepath"
|
|
|
|
// convenience struct for easily getting directories within our test directory.
|
|
// We have one test directory for each test, found in test/_results.
|
|
type Paths struct {
|
|
// e.g. test/_results/test_name
|
|
root string
|
|
}
|
|
|
|
func NewPaths(root string) Paths {
|
|
return Paths{root: root}
|
|
}
|
|
|
|
// when a test first runs, it's situated in a repo called 'repo' within this
|
|
// directory. In its setup step, the test is allowed to create other repos
|
|
// alongside the 'repo' repo in this directory, for example, creating remotes
|
|
// or repos to add as submodules.
|
|
func (self Paths) Actual() string {
|
|
return filepath.Join(self.root, "actual")
|
|
}
|
|
|
|
// this is the 'repo' directory within the 'actual' directory,
|
|
// where a lazygit test will start within.
|
|
func (self Paths) ActualRepo() string {
|
|
return filepath.Join(self.Actual(), "repo")
|
|
}
|
|
|
|
func (self Paths) Config() string {
|
|
return filepath.Join(self.root, "used_config")
|
|
}
|
|
|
|
func (self Paths) Root() string {
|
|
return self.root
|
|
}
|