1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

Fix misc bugs w/ IDE build in folders with a space

- Add quotes to bin/msbuild.bat paths
- Tweak PostBuildCmds in Debugger64 and IDEHelper
- Tweak Debug paths in IDE project to be relative to Workspace
- Modify AppendWithOptionalQuotes to not add more quotes if source string already in quotes
- Modify quoting behavior in build shell command construction
This commit is contained in:
Hunter Bridges 2020-10-12 14:54:08 -07:00
parent 29beeb4e77
commit 81b909c541
6 changed files with 16 additions and 10 deletions

View file

@ -24,8 +24,8 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
DebugWorkingDirectory = "c:\\Beef"
DebugCommandArguments = "-proddir=\"$(WorkspaceDir)\\..\\IDEHelper\\Tests\""
DebugWorkingDirectory = "$(WorkspaceDir)\\.."
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
[Configs.Release.Win32]

View file

@ -7801,10 +7801,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)