diff --git a/cfg/config.go b/cfg/config.go index e5f0ef4..1d8e846 100644 --- a/cfg/config.go +++ b/cfg/config.go @@ -29,7 +29,7 @@ import ( ) const DefaultSeparator string = `(\s\s+|\t)` -const Version string = "v1.2.2" +const Version string = "v1.2.3" const MAXPARTS = 2 var DefaultLoadPath = os.Getenv("HOME") + "/.config/tablizer/lisp" @@ -328,7 +328,16 @@ func (conf *Config) PreparePattern(pattern string) error { func (conf *Config) ParseConfigfile() error { path, err := os.Stat(conf.Configfile) - if os.IsNotExist(err) || path.IsDir() { + if err != nil { + if os.IsNotExist(err) { + // ignore non-existent files + return nil + } + + return fmt.Errorf("failed to stat config file: %w", err) + } + + if path.IsDir() { // ignore non-existent or dirs return nil } diff --git a/lib/lisp.go b/lib/lisp.go index 8916f21..456df64 100644 --- a/lib/lisp.go +++ b/lib/lisp.go @@ -113,8 +113,14 @@ func SetupLisp(conf *cfg.Config) error { // iterate over load-path and evaluate all *.zy files there, if any // we ignore if load-path does not exist, which is the default anyway path, err := os.Stat(conf.LispLoadPath) - if os.IsNotExist(err) { - return nil + + if err != nil { + if os.IsNotExist(err) { + // ignore non-existent files + return nil + } + + return fmt.Errorf("failed to stat path: %w", err) } // init global hooks