x
This commit is contained in:
+9
-10
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user