Skip to content

Commit

Permalink
make move support non windows
Browse files Browse the repository at this point in the history
fixes #510
  • Loading branch information
SimonCropp committed Mar 6, 2021
1 parent 08045a4 commit c4d0a8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/ApprovalTests/Reporters/QuietReporter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using ApprovalTests.Core;

namespace ApprovalTests.Reporters
Expand All @@ -22,7 +23,12 @@ public static void DisplayCommandLineApproval(string approved, string received)

public static string GetCommandLineForApproval(string approved, string received)
{
return $"cmd /c move /Y \"{received}\" \"{approved}\"";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return $"cmd /c move /Y \"{received}\" \"{approved}\"";
}

return $"mv -f \"{received}\" \"{approved}\"";
}

public bool IsWorkingInThisEnvironment(string forFile)
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<LangVersion>8.0</LangVersion>
<NoWarn>CS1591</NoWarn>
<Version>5.4.5</Version>
<Version>5.4.6</Version>
<AssemblyVersion>3.0</AssemblyVersion>
<AssemblyOriginatorKeyFile>$(ProjectDir)..\ApprovalsKeyPair.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down

0 comments on commit c4d0a8c

Please sign in to comment.