default to config.yaml

This commit is contained in:
Massaki Archambault 2024-08-13 22:22:50 -04:00
parent 53450730c9
commit d3e211e1cb
2 changed files with 9 additions and 11 deletions

View File

@ -119,7 +119,6 @@ func LoadConfig(configPath string) (*Config, error) {
}, },
} }
if configPath != "" {
f, err := os.Open(configPath) f, err := os.Open(configPath)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to open config file: %v", err) return nil, fmt.Errorf("failed to open config file: %v", err)
@ -130,7 +129,6 @@ func LoadConfig(configPath string) (*Config, error) {
if err := d.Decode(config); err != nil { if err := d.Decode(config); err != nil {
return nil, fmt.Errorf("failed to parse config file: %v", err) return nil, fmt.Errorf("failed to parse config file: %v", err)
} }
}
// validate forge is set // validate forge is set
if config.FS.Forge != ForgeGithub && config.FS.Forge != ForgeGitlab && config.FS.Forge != ForgeGitea { if config.FS.Forge != ForgeGithub && config.FS.Forge != ForgeGitlab && config.FS.Forge != ForgeGitea {

View File

@ -16,7 +16,7 @@ import (
) )
func main() { func main() {
configPath := flag.String("config", "", "The config file") configPath := flag.String("config", "config.yaml", "The config file")
mountoptionsFlag := flag.String("o", "", "Filesystem mount options. See mount.fuse(8)") mountoptionsFlag := flag.String("o", "", "Filesystem mount options. See mount.fuse(8)")
debug := flag.Bool("debug", false, "Enable debug logging") debug := flag.Bool("debug", false, "Enable debug logging")