Skip to content
Snippets Groups Projects
Commit cf349018 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

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

Allow editing invalid Casks.
parents 69d28f9d 8c3c72ec
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment