Allow symlink plugin directory

This commit is contained in:
10sr
2016-11-30 14:28:13 +09:00
parent 6fbff048f0
commit 92362093ab

View File

@@ -126,7 +126,9 @@ func InitRuntimeFiles() {
// Search configDir for plugin-scripts
files, _ := ioutil.ReadDir(filepath.Join(configDir, "plugins"))
for _, f := range files {
if f.IsDir() {
realpath, _ := filepath.EvalSymlinks(filepath.Join(configDir, "plugins", f.Name()))
realpathStat, _ := os.Stat(realpath)
if realpathStat.IsDir() {
scriptPath := filepath.Join(configDir, "plugins", f.Name(), f.Name()+".lua")
if _, err := os.Stat(scriptPath); err == nil {
AddRuntimeFile(RTPlugin, realFile(scriptPath))