update
This commit is contained in:
+4
-1
@@ -60,11 +60,14 @@ 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 temp")
|
||||||
_, err := cmd.Output()
|
_, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("编译失败:" + err.Error() + "。")
|
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"))
|
sillyGirl.Set("compiled_at", time.Now().Format("2006-01-02 15:04:05"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user