redis: fix error on new install when redis.conf does not exist

Closes Homebrew/homebrew#15754.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Nan Zhong 2012-10-30 11:27:36 -04:00 committed by Mike McQuaid
parent 4f2b723ec9
commit 2965b12f62

View file

@ -31,7 +31,7 @@ class Redis < Formula
end
# Fix redis upgrade from 2.4 to 2.6.
if File.readlines(etc/'redis.conf').grep(/^vm-enabled/)
if File.exists?(etc/'redis.conf') && File.readlines(etc/'redis.conf').grep(/^vm-enabled/)
mv etc/'redis.conf', etc/'redis.conf.old'
ohai "Your redis.conf will not work with 2.6; moved it to redis.conf.old"
end