Skip to content

Commit

Permalink
scripts/sketch_utils.sh: Move the logic that gets the build dir after
Browse files Browse the repository at this point in the history
the part that retrieves the arguments.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
  • Loading branch information
Ouss4 committed Apr 4, 2022
1 parent dac61ca commit ba0bfdf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
return 1
fi

ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
if [ -z "$ARDUINO_BUILD_DIR" ]; then
build_dir="$(dirname $sketch)/build"
else
build_dir="$ARDUINO_BUILD_DIR"
fi
local ide_path=$1
local usr_path=$2
local fqbn=$3
local sketch=$4
local xtra_opts=$5
local win_opts=$6

ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
if [ -z "$ARDUINO_BUILD_DIR" ]; then
build_dir="$(dirname $sketch)/build"
else
build_dir="$ARDUINO_BUILD_DIR"
fi

echo $sketch

rm -rf "$build_dir"
mkdir -p "$build_dir"
mkdir -p "$ARDUINO_CACHE_DIR"
Expand Down

0 comments on commit ba0bfdf

Please sign in to comment.