Skip to content

Commit

Permalink
🔨 Updated 'mfconfig init'
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 16, 2022
1 parent 408a53b commit 3ad684b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 200 deletions.
13 changes: 11 additions & 2 deletions buildroot/share/git/mfconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,25 @@ 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

echo "- Copying extras from Marlin..."
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

Expand Down
198 changes: 0 additions & 198 deletions buildroot/share/scripts/config-labels.py

This file was deleted.

0 comments on commit 3ad684b

Please sign in to comment.