Skip to content

Commit a41cb36

Browse files
committed
Don't fail library installation if it's already installed
1 parent 614677a commit a41cb36

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1515
### Removed
1616

1717
### Fixed
18+
- Library installation no longer "fails" if the library is already installed
1819

1920
### Security
2021

lib/arduino_ci/arduino_cmd.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ def install_boards(boardfamily)
190190
# @param name [String] the library name
191191
# @return [bool] whether the command succeeded
192192
def _install_library(library_name)
193-
success = run_and_capture(flag_install_library, library_name)[:success]
193+
result = run_and_capture(flag_install_library, library_name)
194+
195+
already_installed = result[:err].include?("Library is already installed: #{library_name}")
196+
success = result[:success] || already_installed
194197

195198
@libraries_indexed = (@libraries_indexed || success) if library_name == WORKAROUND_LIB
196199
success
@@ -237,7 +240,7 @@ def library_present?(library_name)
237240
def update_library_index
238241
# install random lib so the arduino IDE grabs a new library index
239242
# see: https://github.com/arduino/Arduino/issues/3535
240-
install_library("USBHost")
243+
install_library(WORKAROUND_LIB)
241244
end
242245

243246
# use a particular board for compilation

0 commit comments

Comments
 (0)