From c863c12608afca43f42d10e76831c6de1304c9c4 Mon Sep 17 00:00:00 2001 From: postmannen Date: Tue, 22 Feb 2022 09:41:59 +0100 Subject: [PATCH] fixed wrong path for startup folder --- message_readers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/message_readers.go b/message_readers.go index 3ee1d41..41f2201 100644 --- a/message_readers.go +++ b/message_readers.go @@ -91,7 +91,9 @@ func (s *server) readStartupFolder() { // getFilePaths will get the names of all the messages in // the folder specified from current working directory. func (s *server) getFilePaths(dirName string) ([]string, error) { - dirPath, err := os.Getwd() + dirPath, err := os.Executable() + dirPath = filepath.Dir(dirPath) + fmt.Printf(" * DEBUG: %v\n", dirPath) if err != nil { return nil, fmt.Errorf("error: startup folder: unable to get the working directory %v: %v", dirPath, err) }