Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Fix build_all_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 23, 2024
1 parent 0c3d1cf commit 4309e6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions buildroot/bin/build_all_examples
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions buildroot/bin/build_example
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; }
Expand Down Expand Up @@ -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"
3 changes: 1 addition & 2 deletions buildroot/bin/mfutil
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; }
Expand Down

0 comments on commit 4309e6a

Please sign in to comment.