Skip to content

Commit 805e991

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents dae03d5 + d555221 commit 805e991

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

WebDriverManager/DriverManager.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.IO;
23
using System.Net;
34
using WebDriverManager.DriverConfigs;
45
using WebDriverManager.Helpers;
@@ -13,13 +14,19 @@ public class DriverManager
1314

1415
private IBinaryService _binaryService;
1516
private readonly IVariableService _variableService;
17+
private string _downloadDirectory = Directory.GetCurrentDirectory();
1618

1719
public DriverManager()
1820
{
1921
_binaryService = new BinaryService();
2022
_variableService = new VariableService();
2123
}
2224

25+
public DriverManager(string downloadDirectory)
26+
{
27+
_downloadDirectory = downloadDirectory;
28+
}
29+
2330
public DriverManager(IBinaryService binaryService, IVariableService variableService)
2431
{
2532
_binaryService = binaryService;
@@ -61,8 +68,7 @@ public string SetUpDriver(IDriverConfig config, string version = VersionResolveS
6168
version = GetVersionToDownload(config, version);
6269
var url = architecture.Equals(Architecture.X32) ? config.GetUrl32() : config.GetUrl64();
6370
url = UrlHelper.BuildUrl(url, version);
64-
var binaryPath = FileHelper.GetBinDestination(config.GetName(), version, architecture,
65-
config.GetBinaryName());
71+
var binaryPath = Path.Combine(_downloadDirectory, config.GetName(), version, architecture.ToString(), config.GetBinaryName());
6672
return SetUpDriverImpl(url, binaryPath);
6773
}
6874
}

0 commit comments

Comments
 (0)