123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!/bin/bash
- function build_examples()
- {
- excludes=("$@")
-
- local exit_code=0
-
- examples=($(find $PWD/examples/ -name "*.pde" -o -name "*.ino"))
-
- local last="${examples[@]:(-1)}"
-
- for example in "${examples[@]}"; do
-
- local example_dir=$(dirname $example)
-
- local example_file=$(basename $example)
-
- for exclude in "${excludes[@]}"; do
- if [ "${example_file}" == "${exclude}" ] ; then
- echo ">>>>>>>>>>>>>>>>>>>>>>>> Skipping ${example_file} <<<<<<<<<<<<<<<<<<<<<<<<<<"
- continue 2
- fi
- done
-
- echo "$example_file: "
- local sketch="$example_dir/$example_file"
- echo "$sketch"
-
-
-
-
- local build_stdout
- build_stdout=$(arduino --verify $sketch 2>&1)
-
- if [ $? -ne 0 ]; then
-
- echo -e "\xe2\x9c\x96"
- echo -e "----------------------------- DEBUG OUTPUT -----------------------------\n"
- echo "$build_stdout"
- echo -e "\n------------------------------------------------------------------------\n"
-
- exit_code=1
- else
-
- echo -e "\xe2\x9c\x93"
- fi
- done
- return $exit_code
- }
|