mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
fixing linux tests
This commit is contained in:
parent
9330f0aefc
commit
05370518c5
6 changed files with 53 additions and 19 deletions
22
NzbDrone.Test.Common/StringExtensions.cs
Normal file
22
NzbDrone.Test.Common/StringExtensions.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using System.IO;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
|
||||
namespace NzbDrone.Test.Common
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string AsOsAgnostic(this string path)
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
if (path.Length > 2 && path[1] == ':')
|
||||
{
|
||||
path = path.Replace(':', Path.DirectorySeparatorChar);
|
||||
}
|
||||
path = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue