Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Adding functionality to handle the user profile folder #16

Merged
merged 3 commits into from
Dec 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Special folders would only work for one user
StanleyGoldman committed Dec 5, 2018
commit 39426d20f5debc744c42f6398ad91bfe8c6ccecc
6 changes: 3 additions & 3 deletions src/BCC.MSBuildLog/Services/BinaryLogProcessor.cs
Original file line number Diff line number Diff line change
@@ -214,10 +214,10 @@ private string GetFilePath(string cloneRoot, string projectFile, string file)
return GetRelativePath(filePath, cloneRoot).Replace("\\", "/");
}

var userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (filePath.IsSubPathOf(userProfilePath))
var dotNugetPosition = filePath.IndexOf(".nuget");
if (dotNugetPosition != -1)
{
return GetRelativePath(filePath, userProfilePath).Replace("\\", "/");
return filePath.Substring(dotNugetPosition).Replace("\\", "/");
}

throw new InvalidOperationException($"FilePath `{filePath}` is not a child of `{cloneRoot}`");