Skip to content

Commit 52a9e5e

Browse files
committed
🔨 Updated 'mfconfig init'
1 parent afef612 commit 52a9e5e

File tree

2 files changed

+11
-200
lines changed

2 files changed

+11
-200
lines changed

buildroot/share/git/mfconfig

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,25 @@ if [[ $ACTION == "init" ]]; then
140140
cp -R "$TEMP/config" .
141141
find config -type f \! -name "Configuration*" -exec rm "{}" \;
142142

143+
addpathlabels() {
144+
find config -name "Conf*.h" -print0 | while read -d $'\0' fn ; do
145+
fldr=$(dirname "$fn")
146+
blank_line=$(awk '/^\s*$/ {print NR; exit}' "$fn")
147+
gsed -i~ "${blank_line}i\\\n#define CONFIG_EXAMPLES_DIR \"$fldr\"\\ " "$fn"
148+
rm -f "$fn~"
149+
done
150+
}
151+
143152
echo "- Adding path labels to all configs..."
144-
config-labels.py >/dev/null 2>&1
153+
addpathlabels
145154

146155
git add . >/dev/null && git commit -m "Examples Customizations" >/dev/null
147156

148157
echo "- Copying extras from Marlin..."
149158
cp -R "$TEMP/config" .
150159

151160
# Apply labels again!
152-
config-labels.py >/dev/null 2>&1
161+
addpathlabels
153162

154163
git add . >/dev/null && git commit -m "Examples Extras" >/dev/null
155164

buildroot/share/scripts/config-labels.py

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)