import-utils.go: addPresetDirs() replaced by addSearchDirs()
This commit is contained in:
parent
f04f5822ec
commit
08e0979cdd
@ -32,6 +32,7 @@ func addEnvImportDirs(dirList []string) []string {
|
||||
return dirList
|
||||
}
|
||||
|
||||
/*
|
||||
func addPresetDirs(ctx ExprContext, ctrlKey string, dirList []string) []string {
|
||||
if dirSpec, exists := getControlString(ctx, ctrlKey); exists {
|
||||
dirs := strings.Split(dirSpec, ":")
|
||||
@ -43,6 +44,25 @@ func addPresetDirs(ctx ExprContext, ctrlKey string, dirList []string) []string {
|
||||
}
|
||||
return dirList
|
||||
}
|
||||
*/
|
||||
|
||||
func addSearchDirs(ctx ExprContext, endingPath string, dirList []string) []string {
|
||||
if dirSpec, exists := getControlString(ctx, ControlSearchPath); exists {
|
||||
dirs := strings.Split(dirSpec, ":")
|
||||
if dirList == nil {
|
||||
dirList = dirs
|
||||
} else {
|
||||
if len(endingPath) > 0 {
|
||||
for _, d := range dirs {
|
||||
dirList = append(dirList, path.Join(d, endingPath))
|
||||
}
|
||||
} else {
|
||||
dirList = append(dirList, dirs...)
|
||||
}
|
||||
}
|
||||
}
|
||||
return dirList
|
||||
}
|
||||
|
||||
func isFile(filePath string) bool {
|
||||
info, err := os.Stat(filePath)
|
||||
|
Loading…
Reference in New Issue
Block a user