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

Fix MacOS local launch errors when there are spaces in paths #1442

Merged
merged 3 commits into from
Jul 30, 2020

Conversation

jamiebrynes7
Copy link
Contributor

@jamiebrynes7 jamiebrynes7 commented Jul 29, 2020

Description

We use osascript for launching a local deployment with spatial. This has some particular rules around quotation, especially as we are running the script inline from a shell.

This resulted in errors when paths had spaces in them. To handle these, I've used the built-in quoting abilities in osascript rather than trying to escape them manually twice (once for shell and once for osascript!).

Tests

  • Renamed gdk-for-unity to gdk for unity on my local machine to test launching a deployment & standalone client.

Documentation

@improbable-prow-robot improbable-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/no-ticket Indicates a PR has no corresponding JIRA ticket labels Jul 29, 2020
@improbable-prow-robot improbable-prow-robot added A: tooling Area: Tooling size/XS Denotes a PR that changes 0-14 lines, ignoring generated files. labels Jul 29, 2020
@jamiebrynes7 jamiebrynes7 marked this pull request as ready for review July 29, 2020 11:17
@improbable-prow-robot improbable-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2020
activate
do script ""cd {Common.SpatialProjectRootDir} && {Common.SpatialBinary} {commandArgs}""
do script ""cd "" & quoted form of projectDir & "" && {Common.SpatialBinary} {commandArgs}""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it almost magic how "quoted form of X" is valid osascript

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah its pretty wild

@jamiebrynes7 jamiebrynes7 force-pushed the bugfix/macos-local-launch branch from f530f7d to 95e1443 Compare July 29, 2020 15:25
@jamiebrynes7 jamiebrynes7 force-pushed the bugfix/macos-local-launch branch from 95e1443 to 27f2d11 Compare July 29, 2020 15:54
@improbable-prow-robot improbable-prow-robot added size/S Denotes a PR that changes 15-39 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-14 lines, ignoring generated files. labels Jul 29, 2020
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jamiebrynes7 jamiebrynes7 merged commit 146d34a into develop Jul 30, 2020
@improbable-prow-robot improbable-prow-robot deleted the bugfix/macos-local-launch branch July 30, 2020 09:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: tooling Area: Tooling jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/S Denotes a PR that changes 15-39 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants