diff options
author | Andrew Janke <andrew@apjanke.net> | 2015-09-28 08:52:03 -0400 |
---|---|---|
committer | Andrew Janke <andrew@apjanke.net> | 2015-09-28 08:52:03 -0400 |
commit | e4fdb083655fc582ebcecb07cd1bd1130077f0e4 (patch) | |
tree | fee07d9adfee79d1c88206ead154a23520ac51cb /plugins/atom/atom.plugin.zsh | |
parent | 5c8b0cc0c1782b34790548498018fb9e0300992b (diff) | |
parent | b05ef1034fffd7b0c29f1558a8a357ccce7ae74b (diff) | |
download | zsh-e4fdb083655fc582ebcecb07cd1bd1130077f0e4.tar.gz zsh-e4fdb083655fc582ebcecb07cd1bd1130077f0e4.tar.bz2 zsh-e4fdb083655fc582ebcecb07cd1bd1130077f0e4.zip |
Merge branch 'master' into copyfile-portability
Diffstat (limited to 'plugins/atom/atom.plugin.zsh')
-rw-r--r-- | plugins/atom/atom.plugin.zsh | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/plugins/atom/atom.plugin.zsh b/plugins/atom/atom.plugin.zsh index 9adb9031a..2711cf0e8 100644 --- a/plugins/atom/atom.plugin.zsh +++ b/plugins/atom/atom.plugin.zsh @@ -1,14 +1,37 @@ -local _atom_paths > /dev/null 2>&1 -_atom_paths=( - "$HOME/Applications/Atom.app" - "/Applications/Atom.app" -) +case $OSTYPE in +darwin*) + local _atom_paths > /dev/null 2>&1 + _atom_paths=( + "$HOME/Applications/Atom.app" + "/Applications/Atom.app" + ) + + for _atom_path in $_atom_paths; do + if [[ -a $_atom_path ]]; then + alias at="open -a '$_atom_path'" + break + fi + done + ;; +cygwin) + local _atom_path > /dev/null 2>&1 + + _atom_path=${LOCALAPPDATA}/atom/bin/atom -for _atom_path in $_atom_paths; do if [[ -a $_atom_path ]]; then - alias at="open -a '$_atom_path'" - break - fi -done + cyg_open_atom() + { + if [[ -n $1 ]]; then + ${_atom_path} `cygpath -w -a $1` + else + ${_atom_path} + fi + } -alias att='at .' + alias at=cyg_open_atom + fi + ;; +linux*) + # Alerts the user if 'atom' is not a found command. + type atom >/dev/null 2>&1 && alias at="atom" || { echo >&2 "You have enabled the atom oh-my-zsh plugin on Linux, but atom is not a recognized command. Please make sure you have it installed before using this plugin."; } +esac |