Skip to content

Commit 273888c

Browse files
committed
[dotnet] do not check OSPlatform if setting environment variable
1 parent 0755e68 commit 273888c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Diff for: dotnet/src/webdriver/SeleniumManager.cs

+8-9
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,25 @@ static SeleniumManager()
4040
{
4141
var currentDirectory = AppContext.BaseDirectory;
4242

43-
string file = "selenium-manager";
44-
string binary = $"selenium-manager/linux/{file}";
45-
4643
if (Environment.GetEnvironmentVariable("SE_MANAGER_PATH") != null)
4744
{
4845
binaryFullPath = Environment.GetEnvironmentVariable("SE_MANAGER_PATH");
4946
}
5047
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
5148
{
52-
file = "selenium-manager.exe";
53-
binary = $"selenium-manager/windows/{file}";
49+
binaryFullPath = Path.Combine(currentDirectory, "selenium-manager\\windows\\selenium-manager.exe");
50+
}
51+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
52+
{
53+
binaryFullPath = Path.Combine(currentDirectory, "selenium-manager\\linux\\selenium-manager");
5454
}
5555
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
5656
{
57-
binary = $"selenium-manager/macos/{file}";
57+
binaryFullPath = Path.Combine(currentDirectory, "selenium-manager\\macos\\selenium-manager");
5858
}
59-
60-
if (binaryFullPath == null)
59+
else
6160
{
62-
binaryFullPath = Path.Combine(currentDirectory, binary);
61+
throw new PlatformNotSupportedException($"Selenium Manager doesn't support your runtime platform: {RuntimeInformation.OSDescription}");
6362
}
6463

6564
if (!File.Exists(binaryFullPath))

0 commit comments

Comments
 (0)