mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
22 lines
562 B
C#
22 lines
562 B
C#
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;
|
|
}
|
|
}
|
|
} |