MCPcopy Create free account
hub / github.com/dolthub/doltgresql / GetRootFolder

Function GetRootFolder

testing/generation/utils/root_folder.go:33–39  ·  view source on GitHub ↗

GetRootFolder returns the location of this project's root folder. This is useful to locate relative directories, which will often be read from and written to for generation. It is assumed that this will always be called from within an IDE.

()

Source from the content-addressed store, hash-verified

31// which will often be read from and written to for generation. It is assumed that this will always be called from
32// within an IDE.
33func GetRootFolder() (RootFolderLocation, error) {
34 _, currentFileLocation, _, ok := runtime.Caller(0)
35 if !ok {
36 return RootFolderLocation{}, errors.Errorf("failed to fetch the location of the current file")
37 }
38 return RootFolderLocation{filepath.Clean(filepath.Join(filepath.Dir(currentFileLocation), "../../.."))}, nil
39}
40
41// MoveRoot returns a new RootFolderLocation that defines the root at the new path. The parameter should be relative to
42// the current root.

Callers 2

mainFunction · 0.92
GetCommandDocsFolderFunction · 0.92

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected