(path string)
| 170 | } |
| 171 | |
| 172 | func 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 | } |
no test coverage detected