Newer
Older
m5stickcplus / src / Upload.sh
@motoki miura motoki miura on 28 Mar 2022 465 bytes remove bin elf
#!/bin/bash

ary=()

for i in *.ino ; do
  ary+=("$i")
done

for i in ${!ary[@]} ; do
  echo "$i : ${ary[$i]}"
done

echo -n "Input num for build&upload (q:quit) > "
read input

if [[ "$input" == "q" ]]; then
  exit
fi

if [ -n "${ary[$input]}" ]; then
  echo "$input : ${ary[$input]}"
  file=${ary[$input]}
  cp ${file} TestBuild/TestBuild.ino
  cd TestBuild
  ./compile.sh && ./upload.sh && ./monitor.sh
  cd .. 
else
  echo "Sorry, ${input} is not found."
fi