Eliminate MM_SERVER_PATH (#24968)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
daf84488cc
Коммит
630bd40141
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/utils"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/testlib/testdata"
|
||||
"github.com/mattermost/mattermost/server/v8/channels/utils/fileutils"
|
||||
"github.com/mattermost/mattermost/server/v8/platform/shared/filestore"
|
||||
)
|
||||
@@ -38,7 +39,11 @@ type testResourceDetails struct {
|
||||
}
|
||||
|
||||
func findFile(path string) string {
|
||||
return fileutils.FindPath(path, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
// Use the testdata path to search from the root of the monorepo.
|
||||
searchPaths := fileutils.CommonBaseSearchPaths()
|
||||
searchPaths = append(searchPaths, filepath.Join(testdata.GetPackagePath(), "../../../"))
|
||||
|
||||
return fileutils.FindPath(path, searchPaths, func(fileInfo os.FileInfo) bool {
|
||||
return !fileInfo.IsDir()
|
||||
})
|
||||
}
|
||||
@@ -53,7 +58,11 @@ func findDir(dir string) (string, bool) {
|
||||
return path.Dir(srcPath), true
|
||||
}
|
||||
|
||||
found := fileutils.FindPath(dir, fileutils.CommonBaseSearchPaths(), func(fileInfo os.FileInfo) bool {
|
||||
// Use the testdata path to search from the root of the monorepo.
|
||||
searchPaths := fileutils.CommonBaseSearchPaths()
|
||||
searchPaths = append(searchPaths, filepath.Join(testdata.GetPackagePath(), "../../../"))
|
||||
|
||||
found := fileutils.FindPath(dir, searchPaths, func(fileInfo os.FileInfo) bool {
|
||||
return fileInfo.IsDir()
|
||||
})
|
||||
if found == "" {
|
||||
|
||||
Ссылка в новой задаче
Block a user