Print error if .lumerc cannot be found

This commit is contained in:
Ryan Cavicchioni 2021-01-15 22:24:39 -06:00
parent 8935a6a91b
commit a8bf5a7b55

View File

@ -17,6 +17,11 @@ func main() {
var config lumecmd.Config var config lumecmd.Config
configPath := getConfigPath() configPath := getConfigPath()
if configPath == "" {
fmt.Println("fatal: ~/.lumerc was not found")
os.Exit(1)
}
if _, err := toml.DecodeFile(configPath, &config); err != nil { if _, err := toml.DecodeFile(configPath, &config); err != nil {
fmt.Printf("fatal: failed to parse %s\n", configPath) fmt.Printf("fatal: failed to parse %s\n", configPath)
fmt.Println(err) fmt.Println(err)