mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-06 08:15:59 +02:00
Merge pull request #585 from eveningstarinc/master
Fix misc bugs w/ IDE build in folders with a space
This commit is contained in:
commit
8ee47190cd
6 changed files with 16 additions and 10 deletions
|
@ -7830,10 +7830,13 @@ namespace IDE
|
|||
else if (runFlags.HasFlag(.ShellCommand))
|
||||
{
|
||||
String shellArgs = scope .();
|
||||
shellArgs.Append("/s ");
|
||||
shellArgs.Append("/c ");
|
||||
shellArgs.Append("\"");
|
||||
IDEUtils.AppendWithOptionalQuotes(shellArgs, fileName);
|
||||
shellArgs.Append(" ");
|
||||
shellArgs.Append(args);
|
||||
shellArgs.Append("\"");
|
||||
startInfo.SetFileName("cmd.exe");
|
||||
startInfo.SetArguments(shellArgs);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,13 @@ namespace IDE
|
|||
|
||||
public static void AppendWithOptionalQuotes(String targetStr, String srcFileName)
|
||||
{
|
||||
if (!srcFileName.Contains(' '))
|
||||
targetStr.Append(srcFileName);
|
||||
else
|
||||
bool hasSpace = srcFileName.Contains(' ');
|
||||
bool alreadyQuoted = (srcFileName.Length > 0 && srcFileName[0] == '"' && srcFileName[srcFileName.Length - 1] == '"');
|
||||
|
||||
if (hasSpace && !alreadyQuoted)
|
||||
targetStr.Append("\"", srcFileName, "\"");
|
||||
else
|
||||
targetStr.Append(srcFileName);
|
||||
}
|
||||
|
||||
public static bool FixFilePath(String filePath, char8 wantSlash, char8 otherSlash)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue