update
This commit is contained in:
@@ -21,18 +21,6 @@ var ExecPath, _ = filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
|
||||
var Config Yaml
|
||||
|
||||
func init() {
|
||||
killp()
|
||||
for _, arg := range os.Args {
|
||||
if arg == "-d" {
|
||||
Daemon()
|
||||
}
|
||||
}
|
||||
ReadYaml(ExecPath+"/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyGirl/main/conf/demo_config.yaml")
|
||||
InitReplies()
|
||||
initToHandleMessage()
|
||||
}
|
||||
|
||||
func ReadYaml(confDir string, conf interface{}, url string) {
|
||||
path := confDir + "config.yaml"
|
||||
if _, err := os.Stat(confDir); err != nil {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package core
|
||||
|
||||
import "os"
|
||||
|
||||
func init() {
|
||||
initStore()
|
||||
killp()
|
||||
for _, arg := range os.Args {
|
||||
if arg == "-d" {
|
||||
Daemon()
|
||||
}
|
||||
}
|
||||
ReadYaml(ExecPath+"/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyGirl/main/conf/demo_config.yaml")
|
||||
InitReplies()
|
||||
initToHandleMessage()
|
||||
initSys()
|
||||
}
|
||||
+1
-1
@@ -20,7 +20,7 @@ func NewBucket(name string) Bucket {
|
||||
return b
|
||||
}
|
||||
|
||||
func init() {
|
||||
func initStore() {
|
||||
var err error
|
||||
db, err = bolt.Open(ExecPath+"/sillyGirl.cache", 0600, nil)
|
||||
if err != nil {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/cdle/sillyGirl/im"
|
||||
)
|
||||
|
||||
func init() {
|
||||
func initSys() {
|
||||
AddCommand("", []Function{
|
||||
{
|
||||
Rules: []string{"raw ^name$"},
|
||||
|
||||
Reference in New Issue
Block a user