verify 728 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Usage:
  2. #
  3. # verify/upload target sketch...
  4. #
  5. # Builds sketch for target
  6. # Target can be: uno, due, d1
  7. #
  8. # Uses the Arduino command line interface
  9. #
  10. # https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
  11. set -e
  12. OPERATION=`basename $0`
  13. TARGET=$1; shift
  14. cp ~/.arduino15/preferences.txt-$TARGET ~/.arduino15/preferences.txt
  15. for F in $*
  16. do
  17. echo
  18. echo ${F}:
  19. rm -rf w
  20. mkdir -p w
  21. cp $F.ino w/
  22. if [ "$TARGET" = "due" ]
  23. then
  24. sed -i '/EEPROM/d' w/$(basename $F).ino
  25. fi
  26. for A in converted-assets/$(basename $F)*_assets.h
  27. do
  28. [ -f $A ] && cp $A w/
  29. done
  30. cd w/
  31. # --preserve-temp-files
  32. # -v
  33. # --upload
  34. $HOME/arduino-1.8.3/arduino --$OPERATION $(basename $F).ino
  35. cd ..
  36. done