* remove unused yaml tags * cscli/cwhub: deduplicate, remove dead code * log.Fatal -> fmt.Errorf * deflate utils.go by moving functions to respective files * indexOf() -> slices.Index() * ItemStatus() + toEmoji() -> Item.status() * Item.versionStatus() * move getSHA256() to loader.go
25 lines
471 B
Go
25 lines
471 B
Go
package csconfig
|
|
|
|
/*cscli specific config, such as hub directory*/
|
|
type Hub struct {
|
|
HubDir string
|
|
ConfigDir string
|
|
HubIndexFile string
|
|
DataDir string
|
|
}
|
|
|
|
func (c *Config) LoadHub() error {
|
|
if err := c.LoadConfigurationPaths(); err != nil {
|
|
return err
|
|
}
|
|
|
|
c.Hub = &Hub{
|
|
HubIndexFile: c.ConfigPaths.HubIndexFile,
|
|
ConfigDir: c.ConfigPaths.ConfigDir,
|
|
HubDir: c.ConfigPaths.HubDir,
|
|
DataDir: c.ConfigPaths.DataDir,
|
|
}
|
|
|
|
return nil
|
|
}
|