From 0c314813bcd7a340228a831fdb277fe7977ad1fc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 9 Aug 2025 00:32:07 +0300 Subject: [PATCH] fix: treat data directory the same in logs as elsewhere logs.go was the only place that explicitly joined `Options.DataDirectory` with the working directory, everywhere else uses it as-is. Changing this means that we can consistently have a `DataDirectory` that is either a relative or an absolute path and have things work just fine. --- internal/cmd/logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/logs.go b/internal/cmd/logs.go index 8e8fcac3aa5502d393200c9e3fa7cacff1301a2e..c30b2b177506d1e5db90820e8e651435611f9093 100644 --- a/internal/cmd/logs.go +++ b/internal/cmd/logs.go @@ -45,7 +45,7 @@ var logsCmd = &cobra.Command{ if err != nil { return fmt.Errorf("failed to load configuration: %v", err) } - logsFile := filepath.Join(cfg.WorkingDir(), cfg.Options.DataDirectory, "logs", "crush.log") + logsFile := filepath.Join(cfg.Options.DataDirectory, "logs", "crush.log") _, err = os.Stat(logsFile) if os.IsNotExist(err) { log.Warn("Looks like you are not in a crush project. No logs found.")