Skip to content

Commit

Permalink
fix CodeBase locations scrubbing on mac (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Apr 11, 2020
1 parent a765e43 commit d0685a5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Verify/Serialization/Scrubbers/CodeBaseLocation.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System.IO;
using System;
using System.IO;

static class CodeBaseLocation
{
static CodeBaseLocation()
{
var assembly = typeof(CodeBaseLocation).Assembly;

var path = assembly.CodeBase
.Replace("file:///", "")
.Replace("file://", "")
.Replace(@"file:\\\", "")
.Replace(@"file:\\", "");
var uri = new UriBuilder(assembly.CodeBase);
var path = Uri.UnescapeDataString(uri.Path);

CurrentDirectory = Path.GetDirectoryName(path);
}
Expand Down

0 comments on commit d0685a5

Please sign in to comment.