Skip to content

Commit 4309e6a

Browse files
committed
πŸ§‘β€πŸ’» Fix build_all_examples
1 parent 0c3d1cf commit 4309e6a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

β€Žbuildroot/bin/build_all_examples

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# build_all_examples [...] branch [resume-from]
1515
#
1616

17-
. mfutil
17+
HERE=`dirname $0`
18+
19+
. "$HERE/mfutil"
1820

1921
GITREPO=https://github.com/MarlinFirmware/Configurations.git
2022
STAT_FILE=./.pio/.buildall
@@ -123,7 +125,7 @@ CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/
123125
for CONF in $CONF_TREE ; do
124126

125127
# Get a config's directory name
126-
DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
128+
DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" )
127129

128130
# If looking for a config, skip others
129131
[[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue

β€Žbuildroot/bin/build_example

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Usage: build_example internal config-home config-folder
66
#
77

8-
. mfutil
8+
HERE=`dirname $0`
9+
10+
. "$HERE/mfutil"
911

1012
# Require 'internal' as the first argument
1113
[[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
@@ -36,6 +38,6 @@ unset IFS; set +f
3638
echo -e "\n#define NO_CONTROLLER_CUSTOM_WIRING_WARNING" >> Marlin/Configuration.h
3739

3840
echo "Building the firmware now..."
39-
$HERE/mftest -s -a -n1 || { echo "Failed"; exit 1; }
41+
"$HERE/mftest" -s -a -n1 || { echo "Failed"; exit 1; }
4042

4143
echo "Success"

β€Žbuildroot/bin/mfutil

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
88
which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
99

10-
SED=$(command -v gsed 2>/dev/null || command -v sed 2>/dev/null)
10+
SED=$(which gsed sed | head -n1)
1111
[[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
1212

1313
OPEN=$( which gnome-open xdg-open open | head -n1 )
1414

1515
SELF=`basename "$0"`
16-
HERE=`dirname "$0"`
1716

1817
# Check if called in the right location
1918
[[ -e "Marlin/src" ]] || { echo -e "This script must be called from a Marlin working copy with:\n ./buildroot/bin/$SELF $1" ; exit ; }

0 commit comments

Comments
Β (0)