Skip to content
Snippets Groups Projects
Commit 931c1902 authored by Hauke Petersen's avatar Hauke Petersen
Browse files

dist: added script for merging Arduino sketches

parent 7855cb37
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# check if at least the application dir and one sketch is given
if [ $# -lt 2 ]
then
echo "[Arduino pre-build] Error: not enough arguments given"
exit 1
fi
# 'consume' the application and arduino directories (first argument)
SRCDIR=$1
shift
APPDIR=$1
shift
# create temporary file and put in the file header
cat ${SRCDIR}/pre.snip > ${APPDIR}/_sketches.cpp
# loop through the given sketches and include them into the temp file
for sketch in $@
do
cat ${sketch} >> ${APPDIR}/_sketches.cpp
done
# and prepend the file with the arduino bootstrapping code
cat ${SRCDIR}/post.snip >> ${APPDIR}/_sketches.cpp
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment