Improve error message for missing PKG source.
This commit is contained in:
parent
82c1e6fb0e
commit
8b17017108
@ -42,7 +42,14 @@ module Cask
|
||||
ohai "Running installer for #{cask}; your password may be necessary."
|
||||
ohai "Package installers may write to any location; options such as --appdir are ignored."
|
||||
unless path.exist?
|
||||
raise CaskError, "pkg source file not found: '#{path.relative_path_from(cask.staged_path)}'"
|
||||
pkg = path.relative_path_from(cask.staged_path)
|
||||
pkgs = Pathname.glob(cask.staged_path/"**"/"*.pkg").map { |path| path.relative_path_from(cask.staged_path) }
|
||||
|
||||
message = "Could not find PKG source file '#{pkg}'"
|
||||
message += ", found #{pkgs.map { |path| "'#{path}'" }.to_sentence} instead" if pkgs.any?
|
||||
message += "."
|
||||
|
||||
raise CaskError, message
|
||||
end
|
||||
|
||||
args = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user