Selaa lähdekoodia

add update.sh ,RUNSH

cuu 5 vuotta sitten
vanhempi
commit
748174b83a
5 muutettua tiedostoa jossa 33 lisäystä ja 7 poistoa
  1. 2 7
      Menu/GameShell/10_Settings/Update/update_page.go
  2. 20 0
      main.go
  3. 1 0
      sysgo/UI/events.go
  4. 1 0
      sysgo/UI/title_bar.go
  5. 9 0
      update.sh

+ 2 - 7
Menu/GameShell/10_Settings/Update/update_page.go

@@ -53,13 +53,8 @@ func (self *UpdateConfirmPage) KeyDown(ev *event.Event) {
   
   if ev.Data["Key"] == UI.CurKeys["B"] {
     if self.GIT == true {
-      cmdpath := fmt.Sprintf("feh --bg-center %s/sysgo/gameshell/wallpaper/updating.png; cd %s ;git pull; git reset --hard %s ; feh --bg-center %s/sysgo/gameshell/wallpaper/loading.png ",
-      launchergo_path,
-      launchergo_path,
-      self.Version,
-      launchergo_path )
-      
-      event.Post(UI.RUNEVT,cmdpath)
+      cmdpath := fmt.Sprintf("update.sh %s ",self.Version)
+      event.Post(UI.RUNSH,cmdpath)
       return
     }
   }

+ 20 - 0
main.go

@@ -264,6 +264,7 @@ func run() int {
 	//fmt.Println(main_screen)
     
 	event.AddCustomEvent(UI.RUNEVT)
+  event.AddCustomEvent(UI.RUNSH)
   
   go FlashLed1(main_screen)
   go InspectionTeam(main_screen)
@@ -300,6 +301,25 @@ func run() int {
             fmt.Println(err)
           }
           os.Exit(0)
+        
+        case UI.RUNSH:
+          main_screen.OnExitCb()      
+          gogame.Quit()          
+          
+          fmt.Println("RUNSH")
+          exec_app_cmd := ev.Data["Msg"]
+          fmt.Println(exec_app_cmd)
+          cmd := exec.Command("/bin/sh",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)          
+      
       }
       
       

+ 1 - 0
sysgo/UI/events.go

@@ -4,4 +4,5 @@ package UI
 const (
     RUNEVT=1
     RESTARTUI=2
+    RUNSH=3
 )

+ 1 - 0
sysgo/UI/title_bar.go

@@ -148,6 +148,7 @@ func (self *TitleBar) RoundRobinCheck() {
       self.CheckBatteryStat()
       ///self.CheckBluetooth()
       self.UpdateWifiStrength()
+      SwapAndShow()
       
     }else if self.InLowBackLight >= 0 {
       self.InLowBackLight +=1

+ 9 - 0
update.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+feh --bg-center /home/cpi/launchergo/sysgo/gameshell/wallpaper/updating.png
+cd /home/cpi/launchergo 
+git pull
+git reset --hard $1
+feh --bg-center /home/cpi/launchergo/sysgo/gameshell/wallpaper/loading.png 
+./load.sh
+