File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
+ export ARDUINO_BUILD_DIR=" $HOME /.arduino/build.tmp"
6
+
5
7
function build(){
6
8
local target=$1
7
9
local fqbn=$2
Original file line number Diff line number Diff line change @@ -8,16 +8,20 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
8
8
fi
9
9
10
10
ARDUINO_CACHE_DIR=" $HOME /.arduino/cache.tmp"
11
- ARDUINO_BUILD_DIR=" $HOME /.arduino/build.tmp"
11
+ if [ -z " $ARDUINO_BUILD_DIR " ]; then
12
+ build_dir=" $( dirname $sketch ) /build"
13
+ else
14
+ build_dir=" $ARDUINO_BUILD_DIR "
15
+ fi
12
16
local ide_path=$1
13
17
local usr_path=$2
14
18
local fqbn=$3
15
19
local sketch=$4
16
20
local xtra_opts=$5
17
21
local win_opts=$6
18
22
19
- rm -rf " $ARDUINO_BUILD_DIR "
20
- mkdir -p " $ARDUINO_BUILD_DIR "
23
+ rm -rf " $build_dir "
24
+ mkdir -p " $build_dir "
21
25
mkdir -p " $ARDUINO_CACHE_DIR "
22
26
$ide_path /arduino-builder -compile -logger=human -core-api-version=10810 \
23
27
-fqbn=$fqbn \
@@ -29,7 +33,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
29
33
-hardware " $usr_path /hardware" \
30
34
-libraries " $usr_path /libraries" \
31
35
-build-cache " $ARDUINO_CACHE_DIR " \
32
- -build-path " $ARDUINO_BUILD_DIR " \
36
+ -build-path " $build_dir " \
33
37
$win_opts $xtra_opts " $sketch "
34
38
}
35
39
You can’t perform that action at this time.
0 commit comments