()
| 46 | * Logs an error if the log file path cannot be resolved. |
| 47 | */ |
| 48 | export function openLogsDirectory() { |
| 49 | const logFilePath = log.transports.file?.getFile()?.path; |
| 50 | |
| 51 | if (!logFilePath) { |
| 52 | logError( |
| 53 | 'openLogsDirectory', |
| 54 | 'Could not find log directory!', |
| 55 | new Error('Directory not found'), |
| 56 | ); |
| 57 | return; |
| 58 | } |
| 59 | |
| 60 | const logDirectory = path.dirname(logFilePath); |
| 61 | shell.openPath(logDirectory); |
| 62 | } |
no test coverage detected