Skip to content

Commit 11b67a5

Browse files
committed
fix
1 parent 0cf6102 commit 11b67a5

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

.github/scripts/on-push.sh

+15-17
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,38 @@ function build {
1010
local chunks_cnt=$3
1111
local build_log=$4
1212
local sketches_file=$5
13-
shift; shift; shift; shift; shift;
14-
local sketches=$*
13+
shift 5
14+
local sketches=("$@")
1515

1616
local BUILD_SKETCH="${SCRIPTS_DIR}/sketch_utils.sh build"
1717
local BUILD_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh chunk_build"
1818

19-
local args="-ai $ARDUINO_IDE_PATH -au $ARDUINO_USR_PATH"
20-
21-
args+=" -t $target"
19+
local args=("-ai" "$ARDUINO_IDE_PATH" "-au" "$ARDUINO_USR_PATH" "-t" "$target")
2220

2321
if [ "$OS_IS_LINUX" == "1" ]; then
24-
args+=" -p $ARDUINO_ESP32_PATH/libraries"
25-
args+=" -i $chunk_index -m $chunks_cnt"
22+
args+=("-p" "$ARDUINO_ESP32_PATH/libraries" "-i" "$chunk_index" "-m" "$chunks_cnt")
2623
if [ -n "$sketches_file" ]; then
27-
args+=" -f $sketches_file"
24+
args+=("-f" "$sketches_file")
2825
fi
2926
if [ "$build_log" -eq 1 ]; then
30-
args+=" -l $build_log"
27+
args+=("-l" "$build_log")
3128
fi
32-
${BUILD_SKETCHES} "${args}"
29+
"${BUILD_SKETCHES}" "${args[@]}"
3330
else
34-
for sketch in ${sketches}; do
35-
local sargs
31+
for sketch in "${sketches[@]}"; do
32+
local sargs=("${args[@]}")
3633
local ctags_version
3734
local preprocessor_version
38-
sargs="$args -s $(dirname "$sketch")"
35+
sargs+=("-s" "$(dirname "$sketch")")
3936
if [ "$OS_IS_WINDOWS" == "1" ] && [ -d "$ARDUINO_IDE_PATH/tools-builder" ]; then
4037
ctags_version=$(ls "$ARDUINO_IDE_PATH/tools-builder/ctags/")
4138
preprocessor_version=$(ls "$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/")
42-
win_opts="-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version
43-
-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
44-
sargs+=" ${win_opts}"
39+
sargs+=(
40+
"-prefs=runtime.tools.ctags.path=$ARDUINO_IDE_PATH/tools-builder/ctags/$ctags_version"
41+
"-prefs=runtime.tools.arduino-preprocessor.path=$ARDUINO_IDE_PATH/tools-builder/arduino-preprocessor/$preprocessor_version"
42+
)
4543
fi
46-
${BUILD_SKETCH} "${sargs}"
44+
"${BUILD_SKETCH}" "${sargs[@]}"
4745
done
4846
fi
4947
}

.github/scripts/sketch_utils.sh

-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ function count_sketches { # count_sketches <path> [target] [file] [ignore-requir
398398
}
399399

400400
function build_sketches { # build_sketches <ide_path> <user_path> <target> <path> <chunk> <total-chunks> [extra-options]
401-
402401
local args=""
403402
while [ -n "$1" ]; do
404403
echo "arg: $1"

0 commit comments

Comments
 (0)