mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-13 00:18: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 (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"os/user"
|
||||||
"github.com/cuu/gogame/time"
|
"github.com/cuu/gogame/time"
|
||||||
"github.com/cuu/LauncherGoDev/sysgo/UI"
|
"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.SetText("Rebooting to Launcher")
|
||||||
main_screen.MsgBox.Draw()
|
main_screen.MsgBox.Draw()
|
||||||
main_screen.SwapAndShow()
|
main_screen.SwapAndShow()
|
||||||
time.BlockDelay(300)
|
time.BlockDelay(550)
|
||||||
cmd := exec.Command("sed","-i","s/launchergo/launcher/g","~/.bashrc")
|
usr, _ := user.Current()
|
||||||
|
dir := usr.HomeDir
|
||||||
|
|
||||||
|
cmd := exec.Command("sed","-i","s/launchergo/launcher/g",dir+"/.bashrc")
|
||||||
cmd.Run()
|
cmd.Run()
|
||||||
|
|
||||||
cmd = exec.Command("sudo","reboot")
|
cmd = exec.Command("sudo","reboot")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user