File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /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
2
14
3
15
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} " ; }
6
18
EXAMPLES=" https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO /config/examples"
7
19
8
20
which curl > /dev/null && TOOL=' curl -L -s -S -f -o wgot'
@@ -12,6 +24,8 @@ restore_configs
12
24
13
25
cd Marlin
14
26
27
+ echo " Fetching $RDIR configurations from $REPO ..."
28
+
15
29
$TOOL " $EXAMPLES /$RDIR /Configuration.h" > /dev/null 2>&1 && mv wgot Configuration.h
16
30
$TOOL " $EXAMPLES /$RDIR /Configuration_adv.h" > /dev/null 2>&1 && mv wgot Configuration_adv.h
17
31
$TOOL " $EXAMPLES /$RDIR /_Bootscreen.h" > /dev/null 2>&1 && mv wgot _Bootscreen.h
You can’t perform that action at this time.
0 commit comments