@@ -318,27 +318,28 @@ function install_libraries()
318318function install_arduino_cli()
319319{
320320 local path=$1
321+ local core_path=$2
321322
322323 local ver=' 1.2.2'
323324 local urlbase=" https://github.com/arduino/arduino-cli/releases/download/v${ver} /arduino-cli_${ver} _"
324325
325326 echo " Arduino CLI ${ver} "
326327
327- mkdir -p ${cache_dir} /cli
328- pushd ${cache_dir} /cli
328+ mkdir -p ${core_path} /dist
329+ pushd ${core_path} /dist
329330
330331 case " ${RUNNER_OS-} " in
331- ( " Linux" )
332+ " Linux" )
332333 fetch_and_unpack " Linux_64bit.tar.gz" \
333334 " d421e2b1cbef59c41e46cf06d077214a1d24cb784030462763781c9d3911cc55257fbcc02a7ee6a2ddda5b459101dc83aeda6b3b5198805bfdce856f82774c93" \
334335 " ${urlbase} Linux_64bit.tar.gz"
335336 ;;
336- ( " Windows" )
337+ " Windows" )
337338 fetch_and_unpack " Windows_64bit.zip" \
338339 " 05b4eb5820fbaf670de00399d40513ecf2de9d0c2c5593a1227be03b2d11ba53e9d14cf6f934110447d6fd15c6a09769606a34fcab32ec3c2dbaa42f4627b072" \
339340 " ${urlbase} Windows_64bit.zip"
340341 ;;
341- ( " macOS" )
342+ " macOS" )
342343 if [ " ${RUNNER_ARCH-} " = " ARM64" ] ; then
343344 fetch_and_unpack " macOS_ARM64.tar.gz" \
344345 " 672693418b730d8ebc57cae2c892553e821706bee06312cc77a598e834afcba7d380df4d337138ecc03a4013a349d89b744b2a3b97fafc214b619856d9162827" \
@@ -349,7 +350,7 @@ function install_arduino_cli()
349350 " ${urlbase} macOS_64bit.tar.gz"
350351 fi
351352 ;;
352- ( * )
353+ * )
353354 echo ' Unknown ${RUNNER_OS} = "' ${RUNNER_OS} ' "'
354355 exit 2
355356 esac
@@ -395,28 +396,36 @@ function install_core()
395396 core_dir=$( dirname " $hardware_core_path " )
396397 mkdir -p " $core_dir "
397398
398- if [ " ${RUNNER_OS-} " = " Windows" ]; then
399- cp -a " $core_path " " ${core_dir} /esp8266"
400- else
401- ln -s " $core_path " " $hardware_core_path "
402- fi
399+ echo $core_dir
400+ # find $core_dir
401+
402+ cp -a " $core_path " " ${core_dir} /esp8266"
403+ # if [ "${RUNNER_OS-}" = "Windows" ]; then
404+ # cp -a "$core_path" "${core_dir}/esp8266"
405+ # else
406+ # ln -s "$core_path" "$hardware_core_path"
407+ # fi
408+
409+ # find $core_dir
403410}
404411
405412function install_arduino()
406413{
414+ set -x
407415 echo ::group::Install arduino
408416 local debug=$1
409417
410- command -v " ${ESP8266_ARDUINO_CLI} " \
411- || install_arduino_cli " ${ESP8266_ARDUINO_CLI} "
412-
413418 local hardware_core_path=" $ESP8266_ARDUINO_HARDWARE /esp8266com/esp8266"
414419 test -d " $hardware_core_path " \
415420 || install_core " $ESP8266_ARDUINO_BUILD_DIR " " $hardware_core_path " " $debug "
416421
422+ command -v " ${ESP8266_ARDUINO_CLI} " \
423+ || install_arduino_cli " ${ESP8266_ARDUINO_CLI} " " $hardware_core_path "
424+
417425 install_libraries " $ESP8266_ARDUINO_BUILD_DIR " " $ESP8266_ARDUINO_LIBRARIES "
418426
419427 echo ::endgroup::
428+ set +x
420429}
421430
422431function arduino_lwip_menu_option()
0 commit comments