Skip to content

Commit

Permalink
feat: support for linux via bash
Browse files Browse the repository at this point in the history
  • Loading branch information
chip committed Sep 16, 2022
1 parent e036919 commit faff8d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 1 addition & 2 deletions files.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ func getConfigValues() {
viper.SetConfigType("yaml")
// Win
viper.AddConfigPath("$HOME/.lazyfivem/")
// Linux
viper.AddConfigPath("etc/lazyfivem/")
viper.AddConfigPath("~/.lazyfivem/")

err := viper.ReadInConfig()
if err != nil {
Expand Down
9 changes: 8 additions & 1 deletion fxserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"fmt"
"os/exec"
"runtime"

"github.com/jroimartin/gocui"
)
Expand Down Expand Up @@ -32,7 +33,13 @@ func updateFxServer(g *gocui.Gui, line string) {

func startFxServer(profile string, g *gocui.Gui) {
path := Servers[profile]
CfxCmd = exec.Command(path)
os := runtime.GOOS
switch os {
case "windows":
CfxCmd = exec.Command(path)
case "linux":
CfxCmd = exec.Command("bash", "-c", path)
}
Writer, _ = CfxCmd.StdinPipe()

r, _ := CfxCmd.StdoutPipe()
Expand Down

0 comments on commit faff8d9

Please sign in to comment.