update
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ type Function struct {
|
|||||||
Cron string
|
Cron string
|
||||||
}
|
}
|
||||||
|
|
||||||
var pname = string(sillyGirl)
|
var pname = regexp.MustCompile(`/([^/\s]+)`).FindStringSubmatch(os.Args[0])[1]
|
||||||
|
|
||||||
var name = func() string {
|
var name = func() string {
|
||||||
return sillyGirl.Get("name", "傻妞")
|
return sillyGirl.Get("name", "傻妞")
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ func GitPull(filename string) (bool, error) {
|
|||||||
func CompileCode() error {
|
func CompileCode() error {
|
||||||
|
|
||||||
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o "+pname)
|
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o "+pname)
|
||||||
NotifyMasters("cd " + ExecPath + " && go build -o " + pname)
|
NotifyMasters(os.Args[0])
|
||||||
_, err := cmd.Output()
|
_, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("编译失败:" + err.Error() + "。")
|
return errors.New("编译失败:" + err.Error() + "。")
|
||||||
|
|||||||
Reference in New Issue
Block a user