on main help sign in
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.

commit0c314813bcd7a340228a831fdb277fe7977ad1fc authorVincent Ambo <mail@tazj.in> dateSat 9 Aug 2025, 00:32 (1 year ago) parent8f45a84
1 file changed+1−1
internal/cmd/logs.go+1−1
internal/cmd/logs.go+1−1
@@ -45,7 +45,7 @@ var logsCmd = &cobra.Command{
4545 if err != nil {
4646 return fmt.Errorf("failed to load configuration: %v", err)
4747 }
48− logsFile := filepath.Join(cfg.WorkingDir(), cfg.Options.DataDirectory, "logs", "crush.log")
48+ logsFile := filepath.Join(cfg.Options.DataDirectory, "logs", "crush.log")
4949 _, err = os.Stat(logsFile)
5050 if os.IsNotExist(err) {
5151 log.Warn("Looks like you are not in a crush project. No logs found.")