default to config.yaml

This commit is contained in:
Massaki Archambault 2024-08-13 22:22:50 -04:00
parent 9009c4b07f
commit 3ea4cfcbf8
2 changed files with 9 additions and 11 deletions

View File

@ -119,17 +119,15 @@ 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) }
} defer f.Close()
defer f.Close()
d := yaml.NewDecoder(f) d := yaml.NewDecoder(f)
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

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")