atom.plugin.zsh 714 B

12345678910111213141516171819202122
  1. # Gets OS Type
  2. unamestr=$(uname -s)
  3. # If OSX
  4. if [[ "$unamestr" == 'Darwin' ]]; then
  5. local _atom_paths > /dev/null 2>&1
  6. _atom_paths=(
  7. "$HOME/Applications/Atom.app"
  8. "/Applications/Atom.app"
  9. )
  10. for _atom_path in $_atom_paths; do
  11. if [[ -a $_atom_path ]]; then
  12. alias at="open -a '$_atom_path'"
  13. break
  14. fi
  15. done
  16. # If Linux
  17. elif [[ "$unamestr" == 'Linux' ]]; then
  18. # Alerts the user if 'atom' is not a found command.
  19. 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."; }
  20. fi