MCPcopy
hub / github.com/httprunner/httprunner / GetProjectRootDirPath

Function GetProjectRootDirPath

hrp/plugin.go:172–189  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

170}
171
172func GetProjectRootDirPath(path string) (rootDir string, err error) {
173 pluginPath, err := locatePlugin(path)
174 if err == nil {
175 rootDir = filepath.Dir(pluginPath)
176 return
177 }
178 // fix: no debugtalk file in project but having proj.json created by startpeoject
179 projPath, err := locateFile(path, projectInfoFile)
180 if err == nil {
181 rootDir = filepath.Dir(projPath)
182 return
183 }
184
185 // failed to locate project root dir
186 // maybe project plugin debugtalk.xx and proj.json are not exist
187 // use current dir instead
188 return env.RootDir, nil
189}

Callers 1

toTestCaseMethod · 0.85

Calls 2

locatePluginFunction · 0.85
locateFileFunction · 0.85

Tested by

no test coverage detected