Quote the ToolAssembly path in BrotliCompress task. (#25101)

Fix #25098
This commit is contained in:
Eric Erhardt 2020-08-20 18:36:09 -05:00 committed by GitHub
parent 04a704c929
commit a700662dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -54,7 +54,18 @@ namespace Microsoft.NET.Sdk.BlazorWebAssembly
}
}
protected override string GenerateCommandLineCommands() => ToolAssembly;
private static string Quote(string path)
{
if (string.IsNullOrEmpty(path) || (path[0] == '\"' && path[path.Length - 1] == '\"'))
{
// it's already quoted
return path;
}
return $"\"{path}\"";
}
protected override string GenerateCommandLineCommands() => Quote(ToolAssembly);
protected override string GenerateResponseFileCommands()
{