macOS: Let find itself when run from an .app #13042

merged 2 commits into from Dec 8, 2016


None yet

4 participants

steakknife commented Oct 21, 2016 edited

Problem This patch is needed because node-gyp doesn't work with a space in Atom -> renamed to This error occurs:

Cannot locate, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing

Use case Developers/others want to multiple versions of Atom side-by-side.

Solution When launched from a Mac .app, a valid, symlinked -> atom/atom-beta will always be contained in it's .app. This also works when a different atom-something symlink points to another in an .app.

@steakknife steakknife fix for renamed .app
Needed because `node-gyp` doesn't work with a space in `Atom`, and developers/others want to multiple versions of Atom side-by-side.
@@ -55,11 +55,17 @@ if [ $EXPECT_OUTPUT ]; then
if [ $OS == 'Mac' ]; then
+ ATOM_APP="$(dirname "$(dirname "$(dirname "$(dirname "$(readlink "$0")")")")")"
steakknife Oct 24, 2016 edited Contributor
        5            4          3        2      1    0
@steakknife steakknife fix direct execute
@steakknife steakknife referenced this pull request in Fred-Barclay/Termination Nov 1, 2016

1.12 beta5 broken #4

ungb commented Dec 5, 2016 edited

hey @steakknife,

I tried the scenario above on current beta and wasn't able to see the error you're seeing. could this possibly be fixed already or maybe I'm doing something wrong? Here's a gif of my repro.


ungb commented Dec 6, 2016

Ah, I was finally able to repro this issue. it's when you open atom from the terminal. I'll test your pr later today and see if it fixes the issue.



ungb commented Dec 7, 2016

I was able to build and test his changes on beta build.

@ungb ungb removed the needs-testing label Dec 7, 2016
@iolsen iolsen merged commit bb68969 into atom:master Dec 8, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
@steakknife steakknife deleted the steakknife:fix-renamed-mac-app branch Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment