This commit is contained in:
cdle
2021-10-01 20:56:22 +08:00
parent 9e3f160f3e
commit 21d714a545
+1 -4
View File
@@ -60,14 +60,11 @@ func GitPull(filename string) (bool, error) {
}
func CompileCode() error {
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o temp")
cmd := exec.Command("sh", "-c", "cd "+ExecPath+" && go build -o "+pname)
_, err := cmd.Output()
if err != nil {
return errors.New("编译失败:" + err.Error() + "。")
}
if err := os.Rename(ExecPath+"/temp", ExecPath+"/"+pname); err != nil {
return errors.New("移动文件:" + err.Error() + "。")
}
sillyGirl.Set("compiled_at", time.Now().Format("2006-01-02 15:04:05"))
return nil
}