atom.plugin.zsh 981 B

12345678910111213141516171819202122232425262728293031323334353637
  1. case $OSTYPE in
  2. darwin*)
  3. local _atom_paths > /dev/null 2>&1
  4. _atom_paths=(
  5. "$HOME/Applications/Atom.app"
  6. "/Applications/Atom.app"
  7. )
  8. for _atom_path in $_atom_paths; do
  9. if [[ -a $_atom_path ]]; then
  10. alias at="open -a '$_atom_path'"
  11. break
  12. fi
  13. done
  14. ;;
  15. cygwin)
  16. local _atom_path > /dev/null 2>&1
  17. _atom_path=${LOCALAPPDATA}/atom/bin/atom
  18. if [[ -a $_atom_path ]]; then
  19. cyg_open_atom()
  20. {
  21. if [[ -n $1 ]]; then
  22. ${_atom_path} `cygpath -w -a $1`
  23. else
  24. ${_atom_path}
  25. fi
  26. }
  27. alias at=cyg_open_atom
  28. fi
  29. ;;
  30. linux*)
  31. # Alerts the user if 'atom' is not a found command.
  32. 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."; }
  33. esac