mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-05-03 23:44:28 +02:00
RESTARTUI
This commit is contained in:
16
main.go
16
main.go
@@ -275,6 +275,7 @@ func run() int {
|
||||
event.AddCustomEvent(UI.RUNEVT)
|
||||
event.AddCustomEvent(UI.RUNSH)
|
||||
event.AddCustomEvent(UI.RUNSYS)
|
||||
event.AddCustomEvent(UI.RESTARTUI)
|
||||
|
||||
go FlashLed1(main_screen)
|
||||
go InspectionTeam(main_screen)
|
||||
@@ -345,6 +346,21 @@ func run() int {
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
case UI.RESTARTUI:
|
||||
main_screen.OnExitCb()
|
||||
gogame.Quit()
|
||||
exec_app_cmd :=" sync & cd "+UI.GetExePath()+"; "+os.Args[0]+";"
|
||||
fmt.Println(exec_app_cmd)
|
||||
cmd := exec.Command("/bin/sh","-c",exec_app_cmd)
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
err = cmd.Process.Release()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user