Skip to content

Commit

Permalink
removed headless, just use io.Discard
Browse files Browse the repository at this point in the history
  • Loading branch information
JensvandeWiel committed Aug 3, 2023
1 parent 20f3f85 commit 28bdb89
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions steamcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ type SteamCMD struct {
Prompts []*Prompt
console *console.Console

stdout io.Writer
Stdout io.Writer
}

func New() *SteamCMD {
// New creates a new SteamCMD instance.
func New(stdout io.Writer) *SteamCMD {
return &SteamCMD{
Prompts: make([]*Prompt, 0),
Stdout: stdout,
}
}

func (s *SteamCMD) RunHeadless() error {
// Run puts all the prompts together and executes them.
func (s *SteamCMD) Run() error {
cmd := "steamcmd"

for _, prompt := range s.Prompts {
cmd += " +" + prompt.FullPrompt
}

cmd += " +quit"

s.console = console.New(cmd, s.stdout)
s.console = console.New(cmd, s.Stdout)
err := s.console.Run()
if err != nil {
return err
Expand Down

0 comments on commit 28bdb89

Please sign in to comment.