mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
use os/user to find user home dir
This commit is contained in:
parent
947cfae038
commit
757741a362
@ -2,6 +2,7 @@ package LauncherPy
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"github.com/cuu/gogame/time"
|
||||
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
||||
|
||||
@ -20,8 +21,11 @@ func (self *LauncherPyPlugin) Run( main_screen *UI.MainScreen ) {
|
||||
main_screen.MsgBox.SetText("Rebooting to Launcher")
|
||||
main_screen.MsgBox.Draw()
|
||||
main_screen.SwapAndShow()
|
||||
time.BlockDelay(300)
|
||||
cmd := exec.Command("sed","-i","s/launchergo/launcher/g","~/.bashrc")
|
||||
time.BlockDelay(550)
|
||||
usr, _ := user.Current()
|
||||
dir := usr.HomeDir
|
||||
|
||||
cmd := exec.Command("sed","-i","s/launchergo/launcher/g",dir+"/.bashrc")
|
||||
cmd.Run()
|
||||
|
||||
cmd = exec.Command("sudo","reboot")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user