From aaf705c5faf3ebe27604277809ca1260705430c9 Mon Sep 17 00:00:00 2001 From: bwl Date: Sun, 29 Jul 2012 00:53:20 -0400 Subject: [PATCH] Adding logic for ~/Applications folder installs of Sublime Text 2 --- plugins/sublime/sublime.plugin.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 91b0279c5..e43bf76f5 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,9 +1,16 @@ # Sublime Text 2 Aliases #unamestr = 'uname' +local _sublime_darwin_subl=/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl + if [[ $('uname') == 'Linux' ]]; then alias st='/usr/bin/sublime_text&' elif [[ $('uname') == 'Darwin' ]]; then - alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' + # Check if Sublime is installed in user's home application directory + if [[ -a $HOME/${_sublime_darwin_subl} ]]; then + alias st='$HOME/${_sublime_darwin_subl}' + else + alias st='${_sublime_darwin_subl}' + fi fi alias stt='st .'