From 83192b5a3d70c4b175ff1c85c12576f1695570a9 Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:44:44 -0800 Subject: [PATCH] Use temporary directory for logs if not specified --- .../Commands/StartEditorServicesCommand.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs index d97a7d24be..43bec090d7 100644 --- a/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs +++ b/src/PowerShellEditorServices.Hosting/Commands/StartEditorServicesCommand.cs @@ -301,13 +301,10 @@ private string GetLogDirPath() string logDir = Path.GetDirectoryName(LogPath); if (string.IsNullOrEmpty(logDir)) { - logDir = Directory.GetCurrentDirectory(); - // Path.GetDirectoryName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); + logDir = Path.Join(Path.GetTempPath(), "PowerShellEditorServices"); } - // Ensure logDir exists Directory.CreateDirectory(logDir); - return logDir; }