The Android Studio location on OSX uses non universal locations, "/Applications" for Android Studio installed standalone (or modern Jetbrains Toolbox), and a "~/Applications/JetBrains Toolbox/" for JetBrains toolbox installs (which mine did not install into).
Using the standard installers, I've ended up with my Toolbox in "/Applications" and my Android Studio in "~/Applications", which is the exact opposite of what ides.js expects. I'm not sure if I'm rocking a more modern setup (on my new-ish M1), but I do think we should try our best to support this variation.
This PR addresses this by detecting the first of four paths that resolve:
However, this requires removing the escaping, as utils.fileExists performs double escaping, yet the utils.generatePlistBuddyCommand requires it, so escaping was placed after dir resolution, and before command generation.
This CAN fail, if a user's home directory has characters in it that require escaping, but... Wow, I mean those people are probably used to headaches.
The Android Studio location on OSX uses non universal locations, "/Applications" for Android Studio installed standalone (or modern Jetbrains Toolbox), and a "~/Applications/JetBrains Toolbox/" for JetBrains toolbox installs (which mine did not install into).
Using the standard installers, I've ended up with my Toolbox in "/Applications" and my Android Studio in "~/Applications", which is the exact opposite of what
ides.js
expects. I'm not sure if I'm rocking a more modern setup (on my new-ish M1), but I do think we should try our best to support this variation.This PR addresses this by detecting the first of four paths that resolve:
"/Applications/Android Studio.app" "$HOME/Applications/Android Studio.app" "/Applications/JetBrains Toolbox/Android Studio.app" "$HOME/Applications/JetBrains Toolbox/Android Studio.app"
However, this requires removing the escaping, as
utils.fileExists
performs double escaping, yet theutils.generatePlistBuddyCommand
requires it, so escaping was placed after dir resolution, and before command generation.This CAN fail, if a user's home directory has characters in it that require escaping, but... Wow, I mean those people are probably used to headaches.