Skip to content

Commit

Permalink
Fixing the default log and pact directory on net standard
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Aug 20, 2017
1 parent bd082cd commit 0e340a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions PactNet/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;

namespace PactNet
{
Expand All @@ -8,7 +9,13 @@ internal static class Constants
public const string InteractionsPath = "/interactions";
public const string InteractionsVerificationPath = "/interactions/verification";
public const string PactPath = "/pact";
public static string DefaultPactDir = $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}pacts{Path.DirectorySeparatorChar}";
public static string DefaultLogDir = $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}logs{Path.DirectorySeparatorChar}";

#if USE_NET4X
public static string DefaultPactDir = Path.GetFullPath($"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}pacts{Path.DirectorySeparatorChar}");
public static string DefaultLogDir = Path.GetFullPath($"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}logs{Path.DirectorySeparatorChar}");
#else
public static string DefaultPactDir = Path.GetFullPath($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}pacts{Path.DirectorySeparatorChar}");
public static string DefaultLogDir = Path.GetFullPath($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}logs{Path.DirectorySeparatorChar}");
#endif
}
}
3 changes: 2 additions & 1 deletion PactNet/PactConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.IO;
using PactNet.Infrastructure.Outputters;

namespace PactNet
Expand Down Expand Up @@ -42,7 +43,7 @@ private static string ConvertToDirectory(string path)
{
if (!path.EndsWith("/") && !path.EndsWith("\\"))
{
return path + "\\";
return path + Path.DirectorySeparatorChar;
}

return path;
Expand Down

0 comments on commit 0e340a1

Please sign in to comment.