1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 20:18:52 +00:00
MarlinFirmware/buildroot/bin/mfutil
2022-08-01 01:59:37 -05:00

23 lines
779 B
Bash
Executable File

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