Skip to content

Commit 416fb66

Browse files
committed
πŸ§‘β€πŸ’» Strip #errors in Configurations deployment
1 parent 2af7657 commit 416fb66

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

β€Žbuildroot/share/git/mfconfig

+10-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ if [[ $ACTION == "init" ]]; then
7474
# a 'BASE' branch with only defaults as a starting point.
7575
#
7676

77+
SED=$(which gsed sed | head -n1)
78+
7779
echo "- Initializing BASE branch..."
7880

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

87+
# Strip all #error lines
88+
IFS=$'\n'; set -f
89+
for fn in $( find $TEMP/config -type f -name "Configuration.h" ); do
90+
$SED -i~ -e "20,30{/#error/d}" "$fn"
91+
rm "$fn~"
92+
done
93+
unset IFS; set +f
94+
8595
# Make sure we're not on the 'BASE' branch...
8696
git checkout init-repo >/dev/null 2>&1 || exit
8797

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

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

0 commit comments

Comments
Β (0)