Skip to content

Commit

Permalink
sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Oct 24, 2023
1 parent 84c3236 commit 7b92ea0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
6 changes: 3 additions & 3 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"fmt"
"io"
"log"
"strconv"
"os"
"time"
"os/exec"
"os/signal"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"

bsrpc "github.com/vinegarhq/vinegar/bloxstraprpc"
"github.com/vinegarhq/vinegar/internal/config"
Expand Down Expand Up @@ -135,7 +135,7 @@ func (b *Binary) Run(args ...string) error {
log.Println("Another Roblox instance is already running, not killing wineprefix")
return
}

if b.Config.AutoKillPrefix {
b.Prefix.Kill()
}
Expand Down
17 changes: 5 additions & 12 deletions cmd/vinegar/vinegar.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import (
"log"
"os"
"path/filepath"
"slices"

"github.com/vinegarhq/vinegar/internal/config"
"github.com/vinegarhq/vinegar/internal/config/editor"
"github.com/vinegarhq/vinegar/internal/config/state"
"github.com/vinegarhq/vinegar/internal/dirs"
"github.com/vinegarhq/vinegar/internal/logs"
"github.com/vinegarhq/vinegar/sysinfo"
"github.com/vinegarhq/vinegar/roblox"
"github.com/vinegarhq/vinegar/sysinfo"
"github.com/vinegarhq/vinegar/wine"
)

Expand Down Expand Up @@ -187,15 +186,9 @@ func Delete() {
}

func Sysinfo(pfx *wine.Prefix) {
cpu := sysinfo.GetCPU()
avx := slices.Contains(cpu.Flags, "avx")
k := sysinfo.GetKernel()
d, err := sysinfo.GetDistro()
if err != nil {
log.Fatal(err)
}

ver, err := pfx.Wine("--version").Output()
cmd := pfx.Wine("--version")
cmd.Stdout = nil // required for Output()
ver, err := cmd.Output()
if err != nil {
log.Fatal(err)
}
Expand All @@ -208,5 +201,5 @@ func Sysinfo(pfx *wine.Prefix) {
* Wine: %s
`

fmt.Printf(info, d, cpu.Model, avx, k, ver)
fmt.Printf(info, sysinfo.Distro, sysinfo.CPU, sysinfo.HasAVX, sysinfo.Kernel, ver)

Check failure on line 204 in cmd/vinegar/vinegar.go

View workflow job for this annotation

GitHub Actions / build

undefined: sysinfo.HasAVX
}
6 changes: 3 additions & 3 deletions wine/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package wine

import (
"errors"
"os"
"io"
"log"
"os"
"os/exec"
)

Expand All @@ -31,7 +31,7 @@ func (p *Prefix) Command(name string, arg ...string) *Cmd {
}

return &Cmd{
Cmd: cmd,
Cmd: cmd,
prefixDir: p.dir,
}
}
Expand All @@ -50,7 +50,7 @@ func (c *Cmd) OutputPipe() (io.Reader, error) {
if c.Process != nil {
return nil, errors.New("OutputPipe after process started")
}

c.SetOutput(nil)

e, err := c.StderrPipe()
Expand Down
3 changes: 1 addition & 2 deletions wine/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ type Prefix struct {
dir string
}


func New(dir string, out io.Writer) Prefix {
return Prefix{
Output: out,
dir: dir,
dir: dir,
}
}

Expand Down

0 comments on commit 7b92ea0

Please sign in to comment.