1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Use WTF's version of spotigopher (#787)

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2019-12-14 21:24:18 -08:00
committed by GitHub
parent 53e795384b
commit b7f8ec5ae2
5 changed files with 11 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package spotigopher
import (
"errors"
"fmt"
"log"
"os/exec"
"runtime"
@@ -161,10 +162,13 @@ func getDarwinInfo(infoType string) string {
default:
args = []string{`-etell application "Spotify" to name of current track as string`}
}
info, err := exec.Command("osascript", args...).Output()
if err != nil {
log.Fatalf("Could not get info: %s", infoType)
// There is likely no current track yet, inform the user
return fmt.Sprintf("Could not get info for: %s", infoType)
}
return strings.Trim(string(info), "\n")
}

4
vendor/modules.txt vendored
View File

@@ -260,10 +260,10 @@ github.com/shirou/gopsutil/internal/common
github.com/shirou/gopsutil/mem
# github.com/spf13/pflag v1.0.3
github.com/spf13/pflag
# github.com/sticreations/spotigopher v0.0.0-20181009182052-98632f6f94b0
github.com/sticreations/spotigopher/spotigopher
# github.com/stretchr/testify v1.4.0
github.com/stretchr/testify/assert
# github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a
github.com/wtfutil/spotigopher/spotigopher
# github.com/wtfutil/todoist v0.0.1
github.com/wtfutil/todoist
# github.com/xanzy/go-gitlab v0.22.2