Skip to content

Commit

Permalink
Ensure log directory is created (#1219)
Browse files Browse the repository at this point in the history
* Ensure log directory is created

* remove duplicate check
  • Loading branch information
TylerLeonhardt authored Mar 9, 2020
1 parent 2c67277 commit 819b802
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ private void StartLogging()

private string GetLogDirPath()
{
if (!string.IsNullOrEmpty(LogPath))
{
return Path.GetDirectoryName(LogPath);
}
string logDir = !string.IsNullOrEmpty(LogPath)
? Path.GetDirectoryName(LogPath)
: Path.GetDirectoryName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

// Ensure logDir exists
Directory.CreateDirectory(logDir);

return Path.GetDirectoryName(
Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location));
return logDir;
}

private void RemovePSReadLineForStartup()
Expand Down

0 comments on commit 819b802

Please sign in to comment.