This commit is contained in:
1-6
2023-07-26 16:28:11 +08:00
parent 8d179d9e88
commit 095f22bec1
+3 -2
View File
@@ -29,13 +29,14 @@ var processes sync.Map
func initNodePlugins() { func initNodePlugins() {
initLanguage() initLanguage()
root := utils.ExecPath + "/plugins" root := strings.ReplaceAll(utils.ExecPath+"/plugins", "\\", "/")
plugins := []string{root} plugins := []string{root}
os.Mkdir(root, 0755) os.Mkdir(root, 0755)
fmt.Println("root", root) fmt.Println("root", root)
filepath.Walk(root, func(path string, info os.FileInfo, err error) error { filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
fmt.Println("path", path)
path = strings.ReplaceAll(path, "\\", "/") path = strings.ReplaceAll(path, "\\", "/")
if !strings.HasPrefix(path, utils.ExecPath+"/plugins/") { if !strings.HasPrefix(path, root+"/") {
return nil return nil
} }
files := strings.Split(strings.Replace(path, root+"/", "", 1), "/") files := strings.Split(strings.Replace(path, root+"/", "", 1), "/")