Warn user not to edit before first update

Because, if you do, your changes will be lost.
This commit is contained in:
Max Howell 2012-08-01 15:56:52 -04:00
parent 148617bc11
commit b51fe22413

View File

@ -2,6 +2,14 @@ require 'formula'
module Homebrew extend self
def edit
unless (HOMEBREW_PREFIX/'.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