mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
minor fix
This commit is contained in:
parent
d26152e14f
commit
37ae53db27
@ -1,6 +1,7 @@
|
|||||||
package LauncherPy
|
package LauncherPy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/user"
|
"os/user"
|
||||||
"github.com/cuu/gogame/time"
|
"github.com/cuu/gogame/time"
|
||||||
@ -24,13 +25,20 @@ func (self *LauncherPyPlugin) Run( main_screen *UI.MainScreen ) {
|
|||||||
time.BlockDelay(550)
|
time.BlockDelay(550)
|
||||||
usr, _ := user.Current()
|
usr, _ := user.Current()
|
||||||
dir := usr.HomeDir
|
dir := usr.HomeDir
|
||||||
|
if usr.Username == "root" {
|
||||||
|
dir = "/home/cpi"
|
||||||
|
}
|
||||||
|
|
||||||
cmd := exec.Command("sed","-i","s/launchergo/launcher/g",dir+"/.bashrc")
|
cmd := exec.Command("sed","-i","s/launchergo/launcher/g",dir+"/.bashrc")
|
||||||
cmd.Run()
|
err := cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
log.Println("sed failed", err)
|
||||||
|
}else {
|
||||||
|
|
||||||
cmd = exec.Command("sudo","reboot")
|
cmd = exec.Command("sudo","reboot")
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var APIOBJ LauncherPyPlugin
|
var APIOBJ LauncherPyPlugin
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user