File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/PowerShellEditorServices.Hosting/Commands Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -298,14 +298,17 @@ private void StartLogging()
298
298
299
299
private string GetLogDirPath ( )
300
300
{
301
- if ( ! string . IsNullOrEmpty ( LogPath ) )
301
+ string logDir = ! string . IsNullOrEmpty ( LogPath )
302
+ ? Path . GetDirectoryName ( LogPath )
303
+ : Path . GetDirectoryName ( Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ) ;
304
+
305
+ // Ensure logDir exists
306
+ if ( ! Directory . Exists ( logDir ) )
302
307
{
303
- return Path . GetDirectoryName ( LogPath ) ;
308
+ Directory . CreateDirectory ( logDir ) ;
304
309
}
305
310
306
- return Path . GetDirectoryName (
307
- Path . GetDirectoryName (
308
- Assembly . GetExecutingAssembly ( ) . Location ) ) ;
311
+ return logDir ;
309
312
}
310
313
311
314
private void RemovePSReadLineForStartup ( )
You can’t perform that action at this time.
0 commit comments