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() {