build fixes

This commit is contained in:
me-no-dev 2019-10-02 11:41:16 +03:00
parent a19c32bba3
commit 14798d0e6a
2 changed files with 11 additions and 3 deletions

View File

@ -110,9 +110,13 @@ function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
function count_sketches() # count_sketches <examples-path>
{
local examples="$1"
rm -rf sketches.txt
if [ ! -d "$examples" ]; then
touch sketches.txt
return 0
fi
local sketches=$(find $examples -name *.ino)
local sketchnum=0
rm -rf sketches.txt
for sketch in $sketches; do
local sketchdir=$(dirname $sketch)
local sketchdirname=$(basename $sketchdir)

View File

@ -27,10 +27,14 @@ function build_pio_sketch(){ # build_pio_sketch <board> <path-to-ino>
function count_sketches() # count_sketches <examples-path>
{
local examples="$1"
local examples="$1"
rm -rf sketches.txt
if [ ! -d "$examples" ]; then
touch sketches.txt
return 0
fi
local sketches=$(find $examples -name *.ino)
local sketchnum=0
rm -rf sketches.txt
for sketch in $sketches; do
local sketchdir=$(dirname $sketch)
local sketchdirname=$(basename $sketchdir)