Skip to content

Commit a65189c

Browse files
committed
👔 Fix and comment use_example_configs
1 parent dfc8acf commit a65189c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

buildroot/bin/use_example_configs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
#!/usr/bin/env bash
2+
#
3+
# use_example_configs [repo:]configpath
4+
#
5+
# Examples:
6+
# use_example_configs Creality/CR-10/CrealityV1
7+
# use_example_configs release-2.0.9.4:Creality/CR-10/CrealityV1
8+
#
9+
# If a configpath has spaces (or quotes) escape them or enquote the path
10+
#
11+
12+
CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g')
13+
[[ $CURR == "bugfix-2.0.x" ]] && BRANCH=bugfix-2.0.x || BRANCH=bugfix-2.1.x
214

315
IFS=: read -r PART1 PART2 <<< "$@"
4-
[ -n "${PART2}" ] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \
5-
|| { REPO=bugfix-2.0.x ; RDIR="${PART1// /%20}" ; }
16+
[[ -n $PART2 ]] && { REPO="$PART1" ; RDIR="${PART2// /%20}" ; } \
17+
|| { REPO=$BRANCH ; RDIR="${PART1// /%20}" ; }
618
EXAMPLES="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/examples"
719

820
which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot'
@@ -12,6 +24,8 @@ restore_configs
1224

1325
cd Marlin
1426

27+
echo "Fetching $RDIR configurations from $REPO..."
28+
1529
$TOOL "$EXAMPLES/$RDIR/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h
1630
$TOOL "$EXAMPLES/$RDIR/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h
1731
$TOOL "$EXAMPLES/$RDIR/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h

0 commit comments

Comments
 (0)