mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-22 00:40:23 +00:00
Merge pull request #469 from 10sr/allowSymlinkedPlugin
Enable plugins even when they are symlinks
This commit is contained in:
commit
ccc68bcf03
1 changed files with 3 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue