update
This commit is contained in:
+1
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user