user2908112
user2908112

Reputation: 535

Symlink to application in mac

I created a symlink to sublime text editor like this in my bin folder:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/MacOS/Sublime\ Text\ 2 ~/bin/sublime

I exported the bin folder to the PATH in .bash_profile like this:

export PATH="$HOME/bin:$PATH"

When I try to open sublime by typing sublime in terminal i get:

xxxxx@xxxx-Air:~$ sublime
2015-08-06 08:05:16.238 sublime[2495:355442] Sparkle Error: the bundle being updated at {
} has no CFBundleIdentifier! This will cause preference read/write to not work properly.

On the other hand, when I try to type the full path like this it works fine:

xxxxx@xxxxx-Air:~$ /Applications/Sublime\ Text\ 2.app/Contents/MacOS/Sublime\ Text\ 2

Is there something wrong with my symlink?

Upvotes: 2

Views: 3432

Answers (2)

allie
allie

Reputation: 11

To launch Sublime Text 2 from the Mac OS X Terminal, create a symlink to SharedSupport/bin/subl instead of MacOS/Sublime\ Text\ 2:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl ~/bin/subl

Upvotes: 1

Michael Dautermann
Michael Dautermann

Reputation: 89509

Yeah. When you did the ln -s command, you didn't link all the way to the binary file for the app. So you got a wacky / unexpected response instead of launching that editor.

Try doing this instead:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/MacOS/Sublime\ Text\ 2 ~/bin/sublime

Upvotes: 0

Related Questions