Skip to content

Commit c0c4f8a

Browse files
committed
Fix MCU script transformation logic.
The old script behaved incorrectly as it replaced all '*' occurrences with the list of files in the given directory. JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
1 parent d803c3b commit c0c4f8a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/generator.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# limitations under the License.
1616

1717
echo "#define JERRY_MCU_SCRIPT \\" > $2
18-
cat $1 | while read line
19-
do
20-
line=$(echo $line | sed 's/"/\\"/g')
21-
echo "\"$line\n\" \\" >> $2
22-
done
18+
# escape all " characters, wrap each line in double quotes and end the line with '\'
19+
sed 's/"/\\"/g' $1 | sed 's/^.*$/"\0" \\/g' >> $2
2320
echo >> $2

0 commit comments

Comments
 (0)