🧑‍💻 Fix build_all_examples

This commit is contained in:
Scott Lahteine 2024-01-22 23:31:04 -06:00
parent 0c3d1cf566
commit 4309e6ab76
3 changed files with 9 additions and 6 deletions

View file

@ -14,7 +14,9 @@
# build_all_examples [...] branch [resume-from]
#
. mfutil
HERE=`dirname $0`
. "$HERE/mfutil"
GITREPO=https://github.com/MarlinFirmware/Configurations.git
STAT_FILE=./.pio/.buildall
@ -123,7 +125,7 @@ CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/
for CONF in $CONF_TREE ; do
# Get a config's directory name
DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" )
# If looking for a config, skip others
[[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue

View file

@ -5,7 +5,9 @@
# Usage: build_example internal config-home config-folder
#
. mfutil
HERE=`dirname $0`
. "$HERE/mfutil"
# Require 'internal' as the first argument
[[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
@ -36,6 +38,6 @@ unset IFS; set +f
echo -e "\n#define NO_CONTROLLER_CUSTOM_WIRING_WARNING" >> Marlin/Configuration.h
echo "Building the firmware now..."
$HERE/mftest -s -a -n1 || { echo "Failed"; exit 1; }
"$HERE/mftest" -s -a -n1 || { echo "Failed"; exit 1; }
echo "Success"

View file

@ -7,13 +7,12 @@
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)
SED=$(which gsed sed | head -n1)
[[ -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 ; }