Quote packages.config paths

This commit is contained in:
Tamas Vajk
2024-06-04 10:46:54 +02:00
parent 2a62bfd0c2
commit 9af6cb8e4b
2 changed files with 9 additions and 8 deletions

View File

@@ -152,12 +152,12 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
private bool RunWithMono => !Win32.IsWindows() && !string.IsNullOrEmpty(Path.GetExtension(nugetExe));
/// <summary>
/// Restore all files in a specified package.
/// Restore all packages in the specified packages.config file.
/// </summary>
/// <param name="package">The package file.</param>
private bool TryRestoreNugetPackage(string package)
/// <param name="packagesConfig">The packages.config file.</param>
private bool TryRestoreNugetPackage(string packagesConfig)
{
logger.LogInfo($"Restoring file {package}...");
logger.LogInfo($"Restoring file \"{packagesConfig}\"...");
/* Use nuget.exe to install a package.
* Note that there is a clutch of NuGet assemblies which could be used to
@@ -169,12 +169,12 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
if (RunWithMono)
{
exe = "mono";
args = $"{nugetExe} install -OutputDirectory {packageDirectory} {package}";
args = $"{nugetExe} install -OutputDirectory \"{packageDirectory}\" \"{packagesConfig}\"";
}
else
{
exe = nugetExe!;
args = $"install -OutputDirectory {packageDirectory} {package}";
args = $"install -OutputDirectory \"{packageDirectory}\" \"{packagesConfig}\"";
}
var pi = new ProcessStartInfo(exe, args)
@@ -195,7 +195,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
}
else
{
logger.LogInfo($"Restored file {package}");
logger.LogInfo($"Restored file \"{packagesConfig}\"");
return true;
}
}
@@ -205,7 +205,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
/// </summary>
public int InstallPackages()
{
return fileProvider.PackagesConfigs.Count(package => TryRestoreNugetPackage(package));
return fileProvider.PackagesConfigs.Count(TryRestoreNugetPackage);
}
private bool HasNoPackageSource()

View File

@@ -0,0 +1 @@
| [...]/Newtonsoft.Json.6.0.4/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll |