This commit is contained in:
cuu 2019-06-26 22:33:02 +08:00
parent 7b7c1982eb
commit 6980b93262

12
main.go
View File

@ -363,7 +363,17 @@ func run() int {
gogame.Quit() gogame.Quit()
fmt.Println("RUNEVT") fmt.Println("RUNEVT")
exec_app_cmd := "cd " + filepath.Dir( strings.Split(strings.TrimSpace(ev.Data["Msg"]), " ")[0] )+";"
endpos := len(ev.Data["Msg"])
space_break_pos := endpos
for i:=0;i<endpos;i++ {
if i > 6 && string(ev.Data["Msg"][i]) == "/" && string(ev.Data["Msg"][i-1]) == " " {
space_break_pos = i-1
break
}
}
exec_app_cmd := "cd " + filepath.Dir( ev.Data["Msg"][:space_break_pos] )+";"
exec_app_cmd += ev.Data["Msg"] exec_app_cmd += ev.Data["Msg"]
exec_app_cmd +="; sync & cd "+UI.GetExePath()+"; "+os.Args[0]+";" exec_app_cmd +="; sync & cd "+UI.GetExePath()+"; "+os.Args[0]+";"
fmt.Println(exec_app_cmd) fmt.Println(exec_app_cmd)