Skip to content

Commit 42044d3

Browse files
committed
Allow installation of hardware packages or libraries from folders that have a dot in the name
1 parent 1b1e9a1 commit 42044d3

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ before_install:
6262
- install_library "https://bitbucket.org/teckel12/arduino-new-ping/downloads/NewPing_v1.8.zip"
6363
# Test library install from .zip file with rename. If the rename doesn't work then any job verifying with Arduino IDE 1.5.6 or older will hang because GitHub changes the folder name to MPU9250-master, which is not a valid folder name on those IDE versions.
6464
- install_library "https://github.com/brianc118/MPU9250/archive/master.zip" "MPU9250"
65+
# Test library install from .zip file/folder that has a dot in the name
66+
- install_library "https://github.com/arduino-libraries/CapacitiveSensor/archive/0.5.1.zip"
6567
# Test library install from git repo
6668
- install_library "https://github.com/sfrwmaker/WirelessOregonV2.git"
6769
# Test library install from git repo with branch
@@ -110,6 +112,8 @@ script:
110112
# Test library installed from .zip with rename
111113
- cd "${SKETCHBOOK_FOLDER}/libraries/MPU9250/examples/MPU9250/"
112114
- build_sketch "MPU9250.ino" "arduino:avr:uno" "false" "newest"
115+
# Test library installed from .zip with dot in the folder name
116+
- build_sketch "${SKETCHBOOK_FOLDER}/libraries/CapacitiveSensor-0.5.1/examples/CapacitiveSensorSketch/CapacitiveSensorSketch.pde" "arduino:avr:uno" "false" "newest"
113117
# Test library installed from .zip
114118
# Test build_sketch with "all" IDE version name
115119
- build_sketch "${SKETCHBOOK_FOLDER}/libraries/NewPing/examples/NewPingExample/NewPingExample.pde" "arduino:avr:uno" "false" "all"

arduino-ci-script.sh

+12-8
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,17 @@ function install_package()
442442
else
443443
cd "$ARDUINO_CI_SCRIPT_TEMPORARY_FOLDER"
444444

445-
# Clean up the temporary folder
446-
rm --force $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./*.*
445+
# Delete everything from the temporary folder
446+
find ./ -mindepth 1 -delete
447447

448448
# Download the package
449449
wget --no-verbose $ARDUINO_CI_SCRIPT_QUIET_OPTION "$packageURL"
450450

451451
# Uncompress the package
452452
extract ./*.*
453453

454-
# Clean up the temporary folder
455-
rm --force $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./*.*
454+
# Delete all files from the temporary folder
455+
find ./ -type f -maxdepth 1 -delete
456456

457457
# Install the package
458458
mv $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./* "${ARDUINO_CI_SCRIPT_SKETCHBOOK_FOLDER}/hardware/"
@@ -546,13 +546,17 @@ function install_library()
546546
local -r newFolderName="$2"
547547
# Download the file to the temporary folder
548548
cd "$ARDUINO_CI_SCRIPT_TEMPORARY_FOLDER"
549-
# Clean up the temporary folder
550-
rm --force $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./*.*
549+
550+
# Delete everything from the temporary folder
551+
find ./ -mindepth 1 -delete
552+
551553
wget --no-verbose $ARDUINO_CI_SCRIPT_QUIET_OPTION "$libraryIdentifier"
552554

553555
extract ./*.*
554-
# Clean up the temporary folder
555-
rm --force $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./*.*
556+
557+
# Delete all files from the temporary folder
558+
find ./ -type f -maxdepth 1 -delete
559+
556560
# Install the library
557561
mv $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION ./* "${ARDUINO_CI_SCRIPT_SKETCHBOOK_FOLDER}/libraries/${newFolderName}"
558562
fi

0 commit comments

Comments
 (0)