This commit is contained in:
1-6
2023-08-09 10:52:34 +08:00
parent 70bad0cc52
commit 2b19690add
12 changed files with 67 additions and 109 deletions
+9 -10
View File
@@ -3,7 +3,6 @@ package core
import (
"errors"
"fmt"
"os"
"regexp"
"strings"
"time"
@@ -15,8 +14,8 @@ import (
"github.com/goccy/go-json"
)
var plugin_path = "/etc/sillyplus/public/"
var plugin_download_file = plugin_path + "download"
// var plugin_path = "/etc/sillyplus/public/"
// var plugin_download_file = plugin_path + "download"
func CheckPluginAddress(address string) error {
if !strings.HasSuffix(address, "list.json") {
@@ -56,13 +55,13 @@ func initPluginPublish() {
}
})
os.MkdirAll(plugin_download_file, 0666)
os.WriteFile(plugin_path+"list.json", utils.JsonMarshal(GetPublicResponse()), 0666)
for _, f := range Functions {
if f.UUID != "" && f.Public {
os.WriteFile(fmt.Sprintf("%s/%s.js", plugin_download_file, f.UUID), []byte(publicScript(plugins.GetString(f.UUID))), 0666)
}
}
// os.MkdirAll(plugin_download_file, 0666)
// os.WriteFile(plugin_path+"list.json", utils.JsonMarshal(GetPublicResponse()), 0666)
// for _, f := range Functions {
// if f.UUID != "" && f.Public {
// os.WriteFile(fmt.Sprintf("%s/%s.js", plugin_download_file, f.UUID), []byte(publicScript(plugins.GetString(f.UUID))), 0666)
// }
// }
}
func publicScript(str string) string {