(env string, defpath string)
| 12 | var loLoaders = []LGFunction{loLoaderPreload, loLoaderLua} |
| 13 | |
| 14 | func loGetPath(env string, defpath string) string { |
| 15 | path := os.Getenv(env) |
| 16 | if len(path) == 0 { |
| 17 | path = defpath |
| 18 | } |
| 19 | path = strings.Replace(path, ";;", ";"+defpath+";", -1) |
| 20 | if os.PathSeparator != '/' { |
| 21 | dir, err := filepath.Abs(filepath.Dir(os.Args[0])) |
| 22 | if err != nil { |
| 23 | panic(err) |
| 24 | } |
| 25 | path = strings.Replace(path, "!", dir, -1) |
| 26 | } |
| 27 | return path |
| 28 | } |
| 29 | |
| 30 | func loFindFile(L *LState, name, pname string) (string, string) { |
| 31 | name = strings.Replace(name, ".", string(os.PathSeparator), -1) |
no test coverage detected
searching dependent graphs…