bump-cask-pr: rescue CaskUnreadableError
The `replace_version_and_checksum` method handles a `CaskInvalidError` when loading a cask (handling casks that aren't valid on Linux) but we can sometimes still encounter an error when bumping a cask with on_system blocks. For example, bumping `displaylink` will produce a `Cask 'displaylink' is unreadable: undefined method 'csv' for nil` error when `SimulateSystem` runs as Linux, as the cask interpolates `version.csv.first` in a `license` string but `version` isn't set on Linux. This adds `Cask::CaskUnreadableError` to the `rescue` arguments, which accounts for this particular situation (allowing `displaylink` to be bumped like before).
This commit is contained in:
parent
38410f5432
commit
612fec47f3
@ -220,7 +220,7 @@ module Homebrew
|
||||
# Handle the cask being invalid for specific os/arch combinations
|
||||
old_cask = begin
|
||||
Cask::CaskLoader.load(cask.sourcefile_path)
|
||||
rescue Cask::CaskInvalidError
|
||||
rescue Cask::CaskInvalidError, Cask::CaskUnreadableError
|
||||
raise unless cask.on_system_blocks_exist?
|
||||
end
|
||||
next if old_cask.nil?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user