Skip to content

Commit

Permalink
Wrap csproj path in quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcassell committed Feb 23, 2024
1 parent 8f345fb commit 4883e12
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ internal static IEnumerable<string> GetAddPackagesCommands(BuildPartition buildP

internal static string GetRestoreCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null, bool excludeOutput = false)
=> new StringBuilder()
.AppendArgument($"restore {csProjPath}")
.AppendArgument("restore")
.AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
.AppendArgument(string.IsNullOrEmpty(artifactsPaths.PackagesDirectoryName) ? string.Empty : $"--packages \"{artifactsPaths.PackagesDirectoryName}\"")
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
.AppendArgument(extraArguments)
Expand All @@ -170,7 +171,9 @@ internal static string GetRestoreCommand(ArtifactsPaths artifactsPaths, BuildPar

internal static string GetBuildCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null, bool excludeOutput = false)
=> new StringBuilder()
.AppendArgument($"build {csProjPath} -c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
.AppendArgument("build")
.AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
.AppendArgument($"-c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
.AppendArgument(extraArguments)
.AppendArgument(GetMandatoryMsBuildSettings(buildPartition.BuildConfiguration))
Expand All @@ -181,7 +184,9 @@ internal static string GetBuildCommand(ArtifactsPaths artifactsPaths, BuildParti

internal static string GetPublishCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null)
=> new StringBuilder()
.AppendArgument($"publish {csProjPath} -c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
.AppendArgument("publish")
.AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
.AppendArgument($"-c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
.AppendArgument(extraArguments)
.AppendArgument(GetMandatoryMsBuildSettings(buildPartition.BuildConfiguration))
Expand Down

0 comments on commit 4883e12

Please sign in to comment.