mfutil 779 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. #
  3. # mfutil - check env and define helpers
  4. #
  5. # Check dependencies
  6. which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
  7. which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
  8. SED=$(command -v gsed 2>/dev/null || command -v sed 2>/dev/null)
  9. [[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
  10. OPEN=$( which gnome-open xdg-open open | head -n1 )
  11. SELF=`basename "$0"`
  12. HERE=`dirname "$0"`
  13. # Check if called in the right location
  14. [[ -e "Marlin/src" ]] || { echo -e "This script must be called from a Marlin working copy with:\n ./buildroot/bin/$SELF $1" ; exit ; }
  15. perror() { echo -e "$0: \033[0;31m$1 -- $2\033[0m" ; }
  16. bugout() { ((DEBUG)) && echo -e "\033[0;32m$1\033[0m" ; }