Compare commits

...

1 Commits

Author SHA1 Message Date
3b664e1996 no need to make the menu handle the player 2021-03-20 19:41:58 +00:00
2 changed files with 5 additions and 5 deletions

View File

@ -14,14 +14,15 @@ func isInstalled(name string) bool {
return true return true
} }
func subExecute(program string, args ...string) ([]byte, error) { func subExecute(program string, args ...string) {
cmd := exec.Command(program, args...) cmd := exec.Command(program, args...)
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stdout
err := cmd.Run() err := cmd.Run()
if err != nil { if err != nil {
fmt.Printf("%v\n", err) fmt.Printf("%v\n", err)
} }
return cmd.CombinedOutput() outp, _ := cmd.CombinedOutput()
fmt.Println(outp)
} }

View File

@ -29,8 +29,7 @@ func RadioMenu(stations []stationRecord) *wmenu.Menu {
if opts[0].Text == "Quit"{Quit()} if opts[0].Text == "Quit"{Quit()}
val := fmt.Sprintf("%s",opts[0].Value) val := fmt.Sprintf("%s",opts[0].Value)
fmt.Printf("Streaming: " + opts[0].Text + "\n") fmt.Printf("Streaming: " + opts[0].Text + "\n")
stdout, _ := subExecute(player(), options(), val) subExecute(player(), options(), val)
fmt.Println(stdout)
err := menu.Run() err := menu.Run()
if err != nil { if err != nil {
log.Fatal("Oops! " + err.Error()) log.Fatal("Oops! " + err.Error())