Skip to content

Commit 042ed54

Browse files
committed
C#: Fix some code quality issues by replacing Path.Combine with Path.Join.
1 parent 401865d commit 042ed54

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/PackagesConfigRestorer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public NugetExeWrapper(FileProvider fileProvider, DependencyDirectory packageDir
8585
if (!HasPackageSource() && useDefaultFeed())
8686
{
8787
// We only modify or add a top level nuget.config file
88-
nugetConfigPath = Path.Combine(fileProvider.SourceDir.FullName, "nuget.config");
88+
nugetConfigPath = Path.Join(fileProvider.SourceDir.FullName, "nuget.config");
8989
try
9090
{
9191
if (File.Exists(nugetConfigPath))
@@ -94,7 +94,7 @@ public NugetExeWrapper(FileProvider fileProvider, DependencyDirectory packageDir
9494

9595
do
9696
{
97-
backupNugetConfig = Path.Combine(tempFolderPath, Path.GetRandomFileName());
97+
backupNugetConfig = Path.Join(tempFolderPath, Path.GetRandomFileName());
9898
}
9999
while (File.Exists(backupNugetConfig));
100100
File.Copy(nugetConfigPath, backupNugetConfig, true);
@@ -162,7 +162,7 @@ private string ResolveNugetExe()
162162
var nugetPath = FileUtils.FindProgramOnPath(executableName);
163163
if (nugetPath is not null)
164164
{
165-
nugetPath = Path.Combine(nugetPath, executableName);
165+
nugetPath = Path.Join(nugetPath, executableName);
166166
logger.LogInfo($"Using nuget.exe from PATH: {nugetPath}");
167167
return nugetPath;
168168
}
@@ -172,8 +172,8 @@ private string ResolveNugetExe()
172172

173173
private string DownloadNugetExe(string sourceDir)
174174
{
175-
var directory = Path.Combine(sourceDir, ".nuget");
176-
var nuget = Path.Combine(directory, "nuget.exe");
175+
var directory = Path.Join(sourceDir, ".nuget");
176+
var nuget = Path.Join(directory, "nuget.exe");
177177

178178
// Nuget.exe already exists in the .nuget directory.
179179
if (File.Exists(nuget))

0 commit comments

Comments
 (0)