Skip to content

Commit a700662

Browse files
authored
Quote the ToolAssembly path in BrotliCompress task. (#25101)
Fix #25098
1 parent 04a704c commit a700662

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Components/WebAssembly/Sdk/src/BrotliCompress.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ private string DotNetPath
5454
}
5555
}
5656

57-
protected override string GenerateCommandLineCommands() => ToolAssembly;
57+
private static string Quote(string path)
58+
{
59+
if (string.IsNullOrEmpty(path) || (path[0] == '\"' && path[path.Length - 1] == '\"'))
60+
{
61+
// it's already quoted
62+
return path;
63+
}
64+
65+
return $"\"{path}\"";
66+
}
67+
68+
protected override string GenerateCommandLineCommands() => Quote(ToolAssembly);
5869

5970
protected override string GenerateResponseFileCommands()
6071
{

0 commit comments

Comments
 (0)