mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-10 01:50:53 +09:00
Use IsOSPlatform instead of checking for /proc (#101547)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
parent
9d02188cdd
commit
7803a96303
1 changed files with 4 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
// The MIT License(MIT)
|
||||
|
@ -31,13 +31,15 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Mono.Linker.Tests.Extensions
|
||||
{
|
||||
public class NPath : IEquatable<NPath>, IComparable
|
||||
{
|
||||
private static readonly StringComparison PathStringComparison = IsLinux () ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
|
||||
private static readonly StringComparison PathStringComparison = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ?
|
||||
StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
|
||||
|
||||
private readonly string[] _elements;
|
||||
private readonly bool _isRelative;
|
||||
|
@ -804,11 +806,6 @@ namespace Mono.Linker.Tests.Extensions
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool IsLinux ()
|
||||
{
|
||||
return Directory.Exists ("/proc");
|
||||
}
|
||||
}
|
||||
|
||||
public static class Extensions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue