Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Strip #errors in Configurations deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 10, 2022
1 parent 2af7657 commit 7a7485c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion buildroot/share/git/mfconfig
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ if [[ $ACTION == "init" ]]; then
# a 'BASE' branch with only defaults as a starting point.
#

SED=$(which gsed sed | head -n1)

echo "- Initializing BASE branch..."

# Use the import branch as the source
Expand All @@ -82,6 +84,13 @@ if [[ $ACTION == "init" ]]; then
# Copy to a temporary location
TEMP=$( mktemp -d ) ; cp -R config $TEMP

# Strip all #error lines
IFS=$'\n'; set -f
for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
$SED -i "20,30{/#error/d}" $fn
done
unset IFS; set +f

# Make sure we're not on the 'BASE' branch...
git checkout init-repo >/dev/null 2>&1 || exit

Expand Down Expand Up @@ -149,7 +158,6 @@ if [[ $ACTION == "init" ]]; then
((COMMIT_STEPS)) && git add . >/dev/null && git commit -m "Reset TPARA..." >/dev/null

# Update the %VERSION% in the README.md file
SED=$(which gsed sed | head -n1)
VERS=$( echo $EXPORT | $SED 's/release-//' )
eval "${SED} -E -i~ -e 's/%VERSION%/$VERS/g' README.md"
rm -f README.md~
Expand Down

0 comments on commit 7a7485c

Please sign in to comment.