We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c67277 commit 819b802Copy full SHA for 819b802
src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs
@@ -298,14 +298,14 @@ private void StartLogging()
298
299
private string GetLogDirPath()
300
{
301
- if (!string.IsNullOrEmpty(LogPath))
302
- {
303
- return Path.GetDirectoryName(LogPath);
304
- }
+ string logDir = !string.IsNullOrEmpty(LogPath)
+ ? Path.GetDirectoryName(LogPath)
+ : Path.GetDirectoryName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
+
305
+ // Ensure logDir exists
306
+ Directory.CreateDirectory(logDir);
307
- return Path.GetDirectoryName(
- Path.GetDirectoryName(
308
- Assembly.GetExecutingAssembly().Location));
+ return logDir;
309
}
310
311
private void RemovePSReadLineForStartup()
0 commit comments