Merge pull request #3323 from reitermarkus/edit-invalid-cask

Allow editing invalid Casks.
This commit is contained in:
Markus Reiter 2017-10-17 22:51:19 +02:00 committed by GitHub
commit cf349018d5

View File

@ -8,9 +8,6 @@ module Hbc
end
def run
cask = casks.first
cask_path = cask.sourcefile_path
odebug "Opening editor for Cask #{cask.token}"
exec_editor cask_path
rescue CaskUnavailableError => e
reason = e.reason.empty? ? "" : "#{e.reason} "
@ -18,6 +15,14 @@ module Hbc
raise e.class.new(e.token, reason)
end
def cask_path
casks.first.sourcefile_path
rescue CaskInvalidError
path = CaskLoader.path(args.first)
return path if path.file?
raise
end
def self.help
"edits the given Cask"
end