Print error if .lumerc cannot be found

This commit is contained in:
Ryan Cavicchioni 2021-01-15 22:24:39 -06:00
parent 1e4a5f988e
commit 84c1be5054
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

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)