mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 06:16:47 -06:00
* was already done, but inconsistently * this style follows homebrew Formula * covers user-facing messages, test titles, comments * some related minor orthography is included, such as the consistent spelling of our project name as "homebrew-cask" * grammar nits
18 lines
588 B
Ruby
18 lines
588 B
Ruby
class Cask::CLI::Edit < Cask::CLI::Base
|
|
def self.run(*args)
|
|
cask_names = cask_names_from(args)
|
|
raise CaskUnspecifiedError if cask_names.empty?
|
|
# only respects the first argument
|
|
cask_name = cask_names.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
|