From 3ad684b10bc8a7c6631dda4e6615238499289013 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 11 Dec 2022 12:56:45 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Updated=20'mfconfig=20init'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfconfig | 13 +- buildroot/share/scripts/config-labels.py | 198 ----------------------- 2 files changed, 11 insertions(+), 200 deletions(-) delete mode 100755 buildroot/share/scripts/config-labels.py diff --git a/buildroot/share/git/mfconfig b/buildroot/share/git/mfconfig index b379317d98..8528859446 100755 --- a/buildroot/share/git/mfconfig +++ b/buildroot/share/git/mfconfig @@ -140,8 +140,17 @@ if [[ $ACTION == "init" ]]; then cp -R "$TEMP/config" . find config -type f \! -name "Configuration*" -exec rm "{}" \; + addpathlabels() { + find config -name "Conf*.h" -print0 | while read -d $'\0' fn ; do + fldr=$(dirname "$fn") + blank_line=$(awk '/^\s*$/ {print NR; exit}' "$fn") + $SED -i~ "${blank_line}i\\\n#define CONFIG_EXAMPLES_DIR \"$fldr\"\\ " "$fn" + rm -f "$fn~" + done + } + echo "- Adding path labels to all configs..." - config-labels.py >/dev/null 2>&1 + addpathlabels git add . >/dev/null && git commit -m "Examples Customizations" >/dev/null @@ -149,7 +158,7 @@ if [[ $ACTION == "init" ]]; then cp -R "$TEMP/config" . # Apply labels again! - config-labels.py >/dev/null 2>&1 + addpathlabels git add . >/dev/null && git commit -m "Examples Extras" >/dev/null diff --git a/buildroot/share/scripts/config-labels.py b/buildroot/share/scripts/config-labels.py deleted file mode 100755 index b571a434b7..0000000000 --- a/buildroot/share/scripts/config-labels.py +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env python3 -# -# for python3.5 or higher -#----------------------------------- -# Within Marlin project MarlinFirmware/Configurations, this program visits all folders -# under .../config/examples/*, processing each Configuration.h, Configuration_adv.h, -# _Bootscreen.h, and _Statusscreen.h, to insert: -# #define CONFIG_EXAMPLES_DIR "examples/