run.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # Part of Zombie Navigator
  3. # Copyright © 2015 Zombie Navigator Developers
  4. dir="`dirname "$0"`"
  5. dir="`cd "$dir";pwd`"
  6. cd "$dir/src"
  7. if [ -x "$1" ] && [ -f "$1" ] ; then
  8. JPM_FIREFOX_BINARY="$1"
  9. elif [ -x "$JPM_FIREFOX_BINARY" ] && [ -f "$JPM_FIREFOX_BINARY" ] ; then
  10. JPM_FIREFOX_BINARY="$JPM_FIREFOX_BINARY"
  11. elif which firefox >/dev/null 2>&1 ; then
  12. JPM_FIREFOX_BINARY="`which firefox`"
  13. elif [ -x "$HOME/.local/bin/firefox" ] ; then
  14. JPM_FIREFOX_BINARY="$HOME/.local/bin/firefox"
  15. elif [ -x "$HOME/bin/firefox" ] ; then
  16. JPM_FIREFOX_BINARY="$HOME/bin/firefox"
  17. elif [ -x "/usr/local/bin/firefox" ] ; then
  18. JPM_FIREFOX_BINARY="/usr/local/bin/firefox"
  19. elif [ -x "/usr/bin/firefox" ] ; then
  20. JPM_FIREFOX_BINARY="/usr/bin/firefox"
  21. elif [ -x "/Applications/Firefox.app/Contents/MacOS/firefox" ] ; then
  22. # OS/X
  23. JPM_FIREFOX_BINARY="/Applications/Firefox.app/Contents/MacOS/firefox"
  24. elif [ -x "$HOME/Applications/Firefox.app/Contents/MacOS/firefox" ] ; then
  25. # OS/X, per user
  26. JPM_FIREFOX_BINARY="$HOME/Applications/Firefox.app/Contents/MacOS/firefox"
  27. fi
  28. if [ "$JPM_FIREFOX_BINARY" ] ; then
  29. export JPM_FIREFOX_BINARY
  30. fi
  31. # Run Firefox
  32. if ! which jpm >/dev/null 2>&1 ; then
  33. echo "Please install jpm somewhere in PATH" >&2
  34. exit 1
  35. fi
  36. jpm run
  37. # vim: ts=4 noet ai