Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorNoRoot means no rootDir was found in the parents ErrorNoRoot = errors.New("could not locate a tkrc.yaml or jsonnetfile.json in the parent directories, which is required to identify the project root.\nRefer to https://tanka.dev/directory-structure for more information") // ErrorNoBase means no baseDir was found in the parents ErrorNoBase = errors.New("could not locate a main.jsonnet in the parent directories, which is required as the entrypoint for the evaluation.\nRefer to https://tanka.dev/directory-structure for more information") )
Functions ¶
func FindParentFile ¶
FindParentFile traverses the parent directory tree for the given `file`, starting from `start` and ending in `stop`. If the file is not found an error is returned.
func Resolve ¶
Resolve the given directory and resolves the jPath around it. This means it: - figures out the project root (the one with .jsonnetfile, vendor/ and lib/) - figures out the environments base directory (the one with the main.jsonnet)
It then constructs a jPath with the base directory, vendor/ and lib/. This results in predictable imports, as it doesn't matter whether the user called called the command further down tree or not. A little bit like git.
Types ¶
type ErrorFileNotFound ¶
type ErrorFileNotFound struct {
// contains filtered or unexported fields
}
ErrorFileNotFound means that the searched file was not found
func (ErrorFileNotFound) Error ¶
func (e ErrorFileNotFound) Error() string