Skip to content

Commit

Permalink
cmd/vinegar: defer autokill
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Oct 22, 2023
1 parent 0b43ad5 commit c7aa21b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,20 @@ func (b *Binary) Run(args ...string) error {
log.Printf("Launching %s", b.Name)
b.Splash.Message("Launching " + b.Alias)

defer func() {
if util.CommFound("Roblox") {
log.Println("Another Roblox instance is already running, not killing wineprefix")
}

if b.Config.AutoKillPrefix {
b.Prefix.Kill()
}
}()

if err := cmd.Run(); err != nil {
return fmt.Errorf("roblox process: %w", err)
}

if util.CommFound("Roblox") {
log.Println("Another Roblox instance is already running, not killing wineprefix")
return nil
}

if b.Config.AutoKillPrefix {
b.Prefix.Kill()
}

return nil
}

Expand Down

0 comments on commit c7aa21b

Please sign in to comment.