From a700662decce4056c23135b8a4e99b44179ea24e Mon Sep 17 00:00:00 2001 From: Eric Erhardt Date: Thu, 20 Aug 2020 18:36:09 -0500 Subject: [PATCH] Quote the ToolAssembly path in BrotliCompress task. (#25101) Fix #25098 --- .../WebAssembly/Sdk/src/BrotliCompress.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs b/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs index 89b3004a5e..9518e81188 100644 --- a/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs +++ b/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs @@ -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() {