1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-06 16:25: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:
Brian Fiete 2020-10-26 09:58:52 -07:00 committed by GitHub
commit 8ee47190cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 10 deletions

View file

@ -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);
}

View file

@ -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)