mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Warn user not to edit before first update
Because, if you do, your changes will be lost.
This commit is contained in:
parent
148617bc11
commit
b51fe22413
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user