Skip to content

Commit b44fab0

Browse files
committed
Raise error on failure of force_install
1 parent 21258fc commit b44fab0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

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

1111
### Changed
1212
- Simplified the use of `Array.each` with a return statement; it's now simply `Array.find`
13+
- `autolocate!` for Arduino installations now raises `ArduinoInstallationError` if `force_install` fails
1314

1415
### Deprecated
1516

lib/arduino_ci/arduino_downloader.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def execute
186186
elsif File.exist? extracted_file
187187
install
188188
else
189-
puts "Arduino force-install failed"
189+
puts "Could not find extracted archive (tried #{extracted_file})"
190190
end
191191

192192
File.exist? self.class.force_install_location

lib/arduino_ci/arduino_installation.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
module ArduinoCI
1515

16+
class ArduinoInstallationError < StandardError; end
17+
1618
# Manage the OS-specific install location of Arduino
1719
class ArduinoInstallation
1820

@@ -94,7 +96,8 @@ def autolocate!
9496
return candidate unless candidate.nil?
9597

9698
# force the install
97-
force_install
99+
raise ArduinoInstallationError, "Failed to force-install Arduino" unless force_install
100+
98101
autolocate
99102
end
100103

0 commit comments

Comments
 (0)