mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Make github a multisource widget
Note, that this is a backwards incompatible change Previous config: ``` repositories: wtf: "wtfutil" ``` New Config: ``` repositories: - "wtfutil/wtf" ```
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/wtf"
|
||||
)
|
||||
|
||||
const defaultTitle = "GitHub"
|
||||
@@ -15,7 +16,7 @@ type Settings struct {
|
||||
apiKey string
|
||||
baseURL string
|
||||
enableStatus bool
|
||||
repositories map[string]interface{}
|
||||
repositories []string
|
||||
uploadURL string
|
||||
username string
|
||||
}
|
||||
@@ -28,7 +29,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITHUB_TOKEN")),
|
||||
baseURL: ymlConfig.UString("baseURL", os.Getenv("WTF_GITHUB_BASE_URL")),
|
||||
enableStatus: ymlConfig.UBool("enableStatus", false),
|
||||
repositories: ymlConfig.UMap("repositories"),
|
||||
repositories: wtf.ToStrs(ymlConfig.UList("repositories")),
|
||||
uploadURL: ymlConfig.UString("uploadURL", os.Getenv("WTF_GITHUB_UPLOAD_URL")),
|
||||
username: ymlConfig.UString("username"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user