From af8605ea4ba1d9856c055c8c76b447e030540e3f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 5 Sep 2016 21:37:02 +0100 Subject: Move developer-focused commands to dev-cmd. --- Library/Homebrew/cmd/edit.rb | 50 -------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 Library/Homebrew/cmd/edit.rb (limited to 'Library/Homebrew/cmd/edit.rb') diff --git a/Library/Homebrew/cmd/edit.rb b/Library/Homebrew/cmd/edit.rb deleted file mode 100644 index ef325b8b6..000000000 --- a/Library/Homebrew/cmd/edit.rb +++ /dev/null @@ -1,50 +0,0 @@ -#: * `edit`: -#: Open all of Homebrew for editing. -#: -#: * `edit` : -#: Open in the editor. - -require "formula" - -module Homebrew - def edit - unless (HOMEBREW_REPOSITORY/".git").directory? - raise <<-EOS.undent - Changes will be lost! - The first time you `brew update', all local changes will be lost, you should - thus `brew update' before you `brew edit'! - EOS - end - - # If no brews are listed, open the project root in an editor. - if ARGV.named.empty? - editor = File.basename which_editor - if editor == "mate" || editor == "subl" - # If the user is using TextMate or Sublime Text, - # give a nice project view instead. - exec_editor HOMEBREW_REPOSITORY+"bin/brew", - HOMEBREW_REPOSITORY+"README.md", - HOMEBREW_REPOSITORY+".gitignore", - *library_folders - else - exec_editor HOMEBREW_REPOSITORY - end - else - # Don't use ARGV.formulae as that will throw if the file doesn't parse - paths = ARGV.named.map do |name| - path = Formulary.path(name) - unless path.file? || ARGV.force? - raise FormulaUnavailableError, name - end - path - end - exec_editor(*paths) - end - end - - def library_folders - Dir["#{HOMEBREW_LIBRARY}/*"].reject do |d| - case File.basename(d) when "LinkedKegs", "Aliases" then true end - end - end -end -- cgit v1.2.3