homebrew-cask-versions/lib/cask/cli/edit.rb
Roland Walker 0954ca4c8f don't use Markdown-style backtick in error msgs
Because backtick has a different meaning in the shell, and the user
may copy-and-paste such text.

Some light re-wording included as well, and a reference to "brew cask edit"
changed to "brew cask cat" for simplicity.
2014-06-18 15:16:26 -04:00

16 lines
495 B
Ruby

module Cask::CLI::Edit
def self.run(*arguments)
raise CaskUnspecifiedError if arguments.empty?
cask_name = arguments.first.sub(/\.rb$/i,'')
cask_path = Cask.path(cask_name)
odebug "Opening editor for Cask #{cask_name}"
unless cask_path.exist?
raise CaskUnavailableError, %Q{#{cask_name}, run "brew cask create #{cask_name}" to create a new cask with this name}
end
exec_editor cask_path
end
def self.help
"edits the cask of the given name"
end
end