Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
Fix MacOS local launch errors when there are spaces in paths (#1442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Brynes authored Jul 30, 2020
1 parent b75637d commit 146d34a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

## Unreleased

### Added

- Added capability to test commands through the `MockConnectionHandler`. [#1437](https://github.com/spatialos/gdk-for-unity/pull/1437)

### Fixed

- Fixed an `IndexOutOfRangeException` that could be thrown when editing your 'Build Configuration' asset. [#1441](https://github.com/spatialos/gdk-for-unity/pull/1441)
- The 'Build Configuration' Inspector window will no longer report your Android SDK installation as missing if you have a completely fresh Unity installation with the bundled Android SDK. [#1441](https://github.com/spatialos/gdk-for-unity/pull/1441)

### Added

- Added capability to test commands through the `MockConnectionHandler`. [#1437](https://github.com/spatialos/gdk-for-unity/pull/1437)
- Fixed a bug where having spaces in the path to your project would cause the 'Local launch' and 'Launch standalone client' menu options to fail on MacOS. [#1442](https://github.com/spatialos/gdk-for-unity/pull/1442)

### Internal

Expand Down
11 changes: 7 additions & 4 deletions workers/unity/Packages/io.improbable.gdk.tools/LocalLaunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ public static void LaunchClient()
{
command = "osascript";
commandArgs = $@"-e 'tell application ""Terminal""
set projectDir to ""{Common.SpatialProjectRootDir}""
activate
do script ""cd {Common.SpatialProjectRootDir} && {Common.SpatialBinary} {commandArgs}""
do script ""cd "" & quoted form of projectDir & "" && {Common.SpatialBinary} {commandArgs}""
end tell'";
unityClientZipName = "[email protected]";
}
Expand Down Expand Up @@ -221,7 +222,7 @@ public static void LaunchLocalDeployment()
var command = Common.SpatialBinary;

#if UNITY_EDITOR_OSX
var commandArgs = $"local launch --enable_pre_run_check=false --snapshot '{toolsConfig.CustomSnapshotPath}' --experimental_runtime={toolsConfig.RuntimeVersion}";
var commandArgs = $"local launch --enable_pre_run_check=false --experimental_runtime={toolsConfig.RuntimeVersion}";
#else
var commandArgs = $"local launch --enable_pre_run_check=false --snapshot \"{toolsConfig.CustomSnapshotPath}\" --experimental_runtime={toolsConfig.RuntimeVersion}";
#endif
Expand All @@ -237,15 +238,17 @@ public static void LaunchLocalDeployment()
command = "osascript";
commandArgs = $@"-e 'tell application ""Terminal""
activate
do script ""cd {Common.SpatialProjectRootDir} && {Common.SpatialBinary} {commandArgs}""
set projectDir to ""{Common.SpatialProjectRootDir}""
set snapshotPath to ""{toolsConfig.CustomSnapshotPath}""
do script ""cd "" & quoted form of projectDir & "" && {Common.SpatialBinary} {commandArgs} --snapshot "" & quoted form of snapshotPath
end tell'";
}

var processInfo = new ProcessStartInfo(command, commandArgs)
{
CreateNoWindow = false,
UseShellExecute = true,
WorkingDirectory = Common.SpatialProjectRootDir
WorkingDirectory = Common.SpatialProjectRootDir,
};

var process = Process.Start(processInfo);
Expand Down

0 comments on commit 146d34a

Please sign in to comment.